从Fluent Mongo过渡到Mongo C#1.4驱动程序 [英] Transition from Fluent Mongo to Mongo C# 1.4 Driver

查看:59
本文介绍了从Fluent Mongo过渡到Mongo C#1.4驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用FluentMongo,并且现在已经在C#驱动程序中添加了LINQ支持,我们将删除对Fluent的依赖,而仅使用官方的C#驱动程序.

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?

推荐答案

希望其他人也会向您报告,但是作为1.4 C#驱动程序中LINQ支持的实现者,我可以告诉您一些期望

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.

总体上,您可以预期某些功能会丢失,而某些新功能会出现.一个区别是,官方的C#驱动程序仅支持LINQ查询,这些查询可以映射到合理等效的MongoDB查询. FluentMongo库将通过构建Javascript where子句或动态构建map/reduce作业等技术来处理一些没有MongoDB等效查询的LINQ查询.官方的C#驱动程序不会这样做,因为我们不希望外观简单的LINQ查询具有出乎意料的效率低下的实现.

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.

将来,我们正在考虑将某些类型的LINQ查询映射到2.2中提供的新聚合框架上.释放服务器.

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.

如果在移植到1.4 C#驱动程序时遇到任何问题,请通过 https://jira报告. mongodb.org/browse/CSHARP ,我们将尽快对其进行检查.

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.

这篇关于从Fluent Mongo过渡到Mongo C#1.4驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆