Answers for "mongodb filter multiple nested properties"

1

mongodb filter multiple nested properties

const results = await Model.aggregate([
  {
    $match: {
      id: {
      	$in: ['someid']
      },
      'foo.bar': true,
      'foo.baz': true
    }
  }
]).exec()
Posted by: Guest on April-09-2022
3

mongodb match multiple nested

// Use $elemMatch
Model.findOne({
	views: {
       $elemMatch: {
           year: 2012,
           month: 6 
       }
    }
}, {
	'views.$': 1
})
Posted by: Guest on October-14-2021

Code answers related to "mongodb filter multiple nested properties"

Code answers related to "Javascript"

Browse Popular Code Answers by Language