MongoDB C100DBA Exam - Topic 1 Question 11 Discussion
Consider that the posts collection contains an array called ratings which contains ratings given to the post by various users in the following format:Which of the following query will return all the documents where the ratings array contains elements that in some combination satisfy the query conditions?
D) db.inventory.find( { ratings: { ratings: { $gt: 5, $lt: 9 } } } )
A) db.inventory.find( { ratings: { $elemMatch: { $gte: 3, $lte: 6 } } } )
B) db.inventory.find( { ratings: { $elemMatch: { $gt: 3, $lt: 6 }
C) db.inventory.find( { ratings: { ratings.$: { $gt: 5, $lt: 9 } } } )
Mauricio
8 months agoKristeen
9 months agoElfriede
9 months agoParis
9 months agoShayne
9 months agoLaurel
9 months agoLatia
9 months agoLawana
9 months agoTamar
9 months agoBarrett
9 months agoArlyne
9 months agoKrissy
9 months ago