Class "Mongodb\LaravelMongodb\Facades\MongoDB" not found #2778
-
| try to join 2 collections company and vendor with companyId use Jenssegers\Mongodb\Facades\MongoDB;$pipeline = [
            [
                '$lookup' => [
                    'from' => 'company', 
                    'localField' => '_id', 
                    'foreignField' => 'companyId', 
                    'as' => 'joinedData'
                ]
            ],
        ];
    
   $results = MongoDB::collection('vendor') 
            ->raw()
            ->aggregate($pipeline)
            ->toArray();
        return $results; | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            GromNaN
          
      
      
        May 23, 2024 
      
    
    Replies: 1 comment
-
| Indeed, there is no  | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        GromNaN
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Indeed, there is no
MongoDBfacade. UseDB::connection('mongodb')instead (mongodbis the connection name).