In Mongodb, I want to get data of those products who don't have any order.
Collections : master_product_details, master_order_details
I'm using normal $lookup query which is giving all records of matched or unmatched with order.
db.master_product_details.aggregate([
{
$match: { seller_user_id : 'seller_id' }
},
{
$lookup : {from: "master_order_details",localField: "seller_sku_id", foreignField: "sku_id", as : "Orders"}
},
{$unwind : '$Orders'},
{$project : { seller_sku_id : 1, product_title : 1, _id : 0}
}
])
Any other way to get result ?