How to make Async Where, Select with MongoDB.Driver.Linq

mongo
mongo
4 Points
2 Posts

I'm using MongoDB driver in c# with following packages:

using MongoDB.Driver;
using MongoDB.Driver.Linq;

We have Async method as:

var me = await peopleCollection.AsQueryable().FirstOrDefaultAsync(x => x.Name == "me");

But to fetch two or more record. I did not found any Async method:

var others = await peopleCollection.AsQueryable().Where(x => x.Name != "me");

How to achieve Async request for this kind of queries?

Views: 56
Total Answered: 0
Total Marked As Answer: 0
Posted On: 09-Sep-2021 01:27

Share:   fb twitter linkedin
Answers
 Log In to Chat