I need to "join" 2 collections in MongoDB, my current version is 3.2.1, I saw that the search pipeline could do what I want, but it sent me error code 16436, exception: unrecognized pipeline stage name: $ search, and I canβt find the answer to the question on the Internet, the only message I saw was from people with the front version of MongoDB.
Here is my code:
db.coursesList.aggregate([{ $lookup: { from: 'companies', localField: 'companyId', foreignField: '_id', as: 'company' } }]);
source share