Querying after populate in Mongoose

后端 未结 6 2074
悲&欢浪女
悲&欢浪女 2020-11-21 16:17

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({
             


        
6条回答
  •  独厮守ぢ
    2020-11-21 16:27

    Try replacing

    .populate('tags').where('tags.tagName').in(['funny', 'politics']) 
    

    by

    .populate( 'tags', null, { tagName: { $in: ['funny', 'politics'] } } )
    

提交回复
热议问题