Answers for "can we search data on array mongodb"

2

search inside array with object mongodb

db.users.find({awards: {$elemMatch: {award:'National Medal', year:1975}}})
Posted by: Guest on January-04-2021
0

searching in json array mongodb

db.test.aggregate([
    { $unwind : "$array"},
    { $match : {"array.value" : "value2"}},
    { $project : { _id : 0, array : 1}}
])
Posted by: Guest on January-20-2022

Code answers related to "can we search data on array mongodb"

Code answers related to "Javascript"

Browse Popular Code Answers by Language