Why does the M220N course not mention or use the Linq provider (AsQueryable)

Hi Everyone,

Just wondering why the M220N course does not focus on the Linq provider at all. I am very new to Mongo and took the course because my dotnet c# project at work is switching over to mongo from postgres. I completed the entire course and learned about the using find and aggregation queries but until today when I was looking at the docs for something I saw a whole section about using Linq via the AsQueryable method. I thought I missed something so I went back and searched the mflix code and AsQueryable is no where to be found?

Is there any reason for this, should I stay away from the Linq syntax and use the Builders instead?

Thanks,

Frank

Hi @Frank_Wisniewski, welcome to the community.
I will surely forward your feedback to the curriculum team and we will surely consider your feedback while updating the course.

For the time being, I would recommend you to take a look at our official LINQ tutorial.

In case you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

Hi @SourabhBagrecha ,

Thanks, it’s not that I have any doubts. So far I really like Mongo, I feel its much more flexible then using postgres. My concern is what is the official guidance? I did some research and found some people claim that using the Linq method can create non optimal queries that run slow and are hard to diagnose. I also discovered that there is a Linq3 driver in the works, should I take that as a sign that the Linq2 driver should not be used and instead focus on learning the MQL way of doing things? Since I am just starting out with Mongo I don’t want to go down the wrong path.

Thanks,

Frank

Hi, @Frank_Wisniewski,

We introduced the LINQ3 provider as opt-in starting in the 2.14.0 driver. We will be making LINQ3 the default in an upcoming 2.x release.

In both LINQ2 and LINQ3 we attempt to provide straightforward translations of LINQ to MQL. LINQ is translated into aggregation pipeline stages and the server does a lot of optimizations on those stages. If you find a scenario where LINQ3 generates MQL that the server cannot optimize, please file a new CSHARP JIRA ticket and we will be happy to investigate.

Whether to use LINQ, fluent find, or fluent aggregation depends on what you find easiest to express your intent with. All are fully supported APIs for interacting with MongoDB and should have similar performance characteristics.

Sincerely,
James

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.