Reputation: 5369
If I want to find documents for more than one query parameter(sorry if not using correct wording), how do I do this? i am using the c# driver.
Example
I want to find documents for both provider1 and provider2
I can do it for one i.e.
collection.Find(Query.EQ("ProviderId", providerId))
In TSQL:
Select * From ProviderTable
Where ProviderId In (1,2)
Upvotes: 0
Views: 1329
Reputation: 18628
If I understand you correctly, you're looking for this:
var ids = new List<int> {1, 2};
var results = collection.Find(Query.In("ProviderId", new BsonArray(ids)));
Upvotes: 2