简体   繁体   中英

mongodb find query filter where a property is at least equal to one of the items in array

So I am using mongodb as database and I am trying to make find query where a property called "for" value is at least equal to one of the items in array like this: Model.find({property: {$someMongoLogic: [item1, item2]}})

You can use $in operator:

Model.find({property: {$in: [item1, item2]}})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM