आप लगभग वहां थे, आपको बस सही $match
क्वेरी जो इस प्रकार है:
ubBike.aggregate([
{ "$match": { "cust": req.query._id } },
{
"$lookup": {
"from": "appos",
"localField": "_id",
"foreignField": "bike",
"as": "appointments"
}
},
{ "$match": { "appointments.status": { "$ne": "Booked" } } }
]).exec(function(err, bikes){
if(err) throw err;
res.send(bikes);
});