MongoDB. Find documents which contain value from array -
so have array values.
how can find documents contain in specific field value array?
for example:
array : ["1", "2"]
documents
{field : "1"}, {field : "2"}, {field : "3"}
i need find:
{field : "1"}, {field : "2"}
can please try this?
db.inventory.find( { field: { $in: [ "1", "2"] } } )
Comments
Post a Comment