For example I have n documents:
{ _id : 1 }
{ _id : 2 }
{ _id : 3 }
...
{ _id : n }
By some logic I got array of m _ids: [1, 30, 500, 1001, …, i ];
Is it possible to make ONE request using array of _ids for retrieving Cursor of these m documents? I do not want to make separate requests like:
db.things.findOne({_id:1});
db.things.findOne({_id:30});
db.things.findOne({_id:500});
db.things.findOne({_id:1001});
…
db.things.findOne({_id:i});
And if it is possible, how do that on JavaScript Shell and with official C# driver?
Thank you!!!
1 Answer