Hello Everyone !
I want to join two collections products and transactions using $lookup
The structures of the two collections are :
I want to list all transactions that have status “sold” for every product
First, I want just to have all transactions of each product
I tried to do this :
But did’t work ?!
The goal is return all documents that contain the product id in status of transactions.
I try using this with “status.$id” but don’t work.
I want to know if there is another way to query nested documents instead of dot notation ?
Also How to join two collections in a specific condition (like in SQL) not just with localField and foreighField ?
Thanks !