Closed zhujinhu21 closed 8 years ago
2 example documents of users:
{ "_id": ObjectId("abc"), "name": "Miroslav", "tenants": [ "jin" ] }
{ "_id": ObjectId("abd"), "name": "Lothar", "tenants": [ "zhu" ] } And I want to fire a single query to Mongo and get the matching documents . like sql server select * from users where id in('abc','abd') how MongoRepository to do. thank you.
myrepo.Where(i => new [] { "abc", "abd" }.Contains(i.Id))
Written from the top of my head, details could slightly differ.
2 example documents of users:
{ "_id": ObjectId("abc"), "name": "Miroslav", "tenants": [ "jin" ] }
{ "_id": ObjectId("abd"), "name": "Lothar", "tenants": [ "zhu" ] } And I want to fire a single query to Mongo and get the matching documents . like sql server select * from users where id in('abc','abd') how MongoRepository to do. thank you.