$lookup and let and pipeline

I am working on Node.js and when I connect node.js with mongo database which is on Azure cosmos. it show an error “MongoServerError: let not supported”.
I am using Mongodb version 4.4. how to fix this issue
When i read microsoft document i show

“The $lookup aggregation does not yet support the uncorrelated subqueries feature introduced in server version 3.6. You will receive an error with a message containing let is not supported if you attempt to use the $lookup operator with let and pipeline fields”

Hi @Avish_Pratap_Singh and welcome in the MongoDB Community :muscle: !

Cosmos is Cosmos and MongoDB is MongoDB. Cosmos tries to imitates some features of MongoDB but is severely lagging behind as you can see (we are about to release MongoDB 6.0 in the next few weeks).

If you want the real MongoDB with ALL the features fully implemented and supported, take a real MongoDB cluster on MongoDB Atlas.

You can also use Atlas directly from the Azure Marketplace.

Cheers,
Maxime.

2 Likes

This is the same thread as MongoServerError: let not supported database is on Azure - #2 by steevej.

1 Like

I have never seen the following syntax.

Could you provide some working examples including sample documents?