I\'m pretty new to Mongoose and MongoDB in general so I\'m having a difficult time figuring out if something like this is possible:
Item = new Schema({
what you are asking for isn't directly supported but can be achieved by adding another filter step after the query returns.
first, .populate( 'tags', null, { tagName: { $in: ['funny', 'politics'] } } )
is definitely what you need to do to filter the tags documents. then, after the query returns you'll need to manually filter out documents that don't have any tags
docs that matched the populate criteria. something like:
query....
.exec(function(err, docs){
docs = docs.filter(function(doc){
return doc.tags.length;
})
// do stuff with docs
});