0

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)

1 Answer 1

2

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)));
Sign up to request clarification or add additional context in comments.

1 Comment

Where does the class Query come from?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.