I'm trying to filter using multiple items in a nested object in mongoose. The model is like this:
{
name: String
...
links: {url: String, canQuery: bool}
}
So I know you can filter by using
User.find({'links.url':{$ne:req.params.query}}, function(err, foundUsers){
// ---
});
but I need to verify 2 paramaters, 1 the url and 2 the canQuery. I tried this but it doesn't work:
User.find({links:{url: {$ne:req.params.query}, canQuery: true}}, function(err, foundUsers){
// ---
});
How can I filter by multiple properties in a nested object
question from:
https://stackoverflow.com/questions/65840332/querying-nested-documents-using-mongoose-not-working 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…