Answers for "Query mongo by array key"

0

Query mongo by array key

db.test.find(
    {"shapes.color": "red"}, 
    {_id: 0, shapes: {$elemMatch: {color: "red"}}});
Posted by: Guest on August-21-2021

Browse Popular Code Answers by Language