Mongoose - condition that is valid for all elements in nested array Mongoose - condition that is valid for all elements in nested array mongoose mongoose

Mongoose - condition that is valid for all elements in nested array


Instead of finding documents where each item has a price smaller than 100, you can find documents where no item has price bigger than or equal 100.

Model.find({'items.totalPrice': {$not: {$gte: 100}}})

Mongo Playground