Solution 1:
You can use aggregate method to achieve it, check below:
Categories.aggregate([
{ $match: { $and: [{id: "fhsjd" }, { "items.name" : "ramen" } ] } },
{ $project: { _id: 0, menu_items: 1 } }
])
Here you can $match for query and $project for filter (0: to exclude and 1 to include)
Solution 2:
To return specific record, use below:
Categories.find({ "items.name" : "ramen" }, { items: 1, _id: 0 })
To return all items, use below:
Categories.find({}, { items: 1, _id: 0 })
Hope one of the solution works for you.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…