Vous y étiez presque, vous aviez juste besoin du bon $match
requête qui suit :
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);
});