Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transition from Fluent Mongo to Mongo C# 1.4 Driver

We are using FluentMongo and now that LINQ support has been added into the C# driver, we are going to remove the dependency on Fluent and go with the official C# driver alone.

Has anyone done this already, and was it simple and straightforward? Is there anything we need to be looking out for?

like image 374
Zaid Masud Avatar asked Dec 10 '22 01:12

Zaid Masud


1 Answers

Hopefully others will report back to you as well, but as the implementer of the LINQ support in the 1.4 C# driver I can tell you a bit about what to expect.

Overall you can expect some features to be missing and some new ones to be present. One difference is that the official C# driver only supports LINQ queries that can be mapped to reasonably equivalent MongoDB queries. The FluentMongo library would handle some LINQ queries that didn't have MongoDB equivalent queries with techniques like building Javascript where clauses or dynamically building map/reduce jobs. The official C# driver is not going to do that, because we don't want deceptively simple looking LINQ queries to have unexpectedly inefficient implementations.

In the future we are looking at mapping certain types of LINQ queries onto the new aggregation framework coming in the 2.2. release of the server.

If you run into any issues porting to the 1.4 C# driver please report them at https://jira.mongodb.org/browse/CSHARP and we will look at them as quickly as possible.

like image 149
Robert Stam Avatar answered Dec 26 '22 16:12

Robert Stam