I have collections, each entry has fields: placement_id, program_id, category, ... I need to find all placements that have program_id = 3 or 5, and return only the place_id list.
when i tried this command:
db.placements.find({program_id:{$in: [3, 5]}}, {placement_id:1, _id:0})
I have entries:
{ "placement_id" : 196 } { "placement_id" : 197 } { "placement_id" : 198 } ...
is there any way to return simply:
[196, 197, 198...]
mongodb
user468587
source share