Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

mongodb match multiple nested

// Use $elemMatch
Model.findOne({
	views: {
       $elemMatch: {
           year: 2012,
           month: 6 
       }
    }
}, {
	'views.$': 1
})
 
PREVIOUS NEXT
Tagged: #mongodb #match #multiple #nested
ADD COMMENT
Topic
Name
2+4 =