What is the most mature MongoDB driver for C#?

前端 未结 7 1835
孤独总比滥情好
孤独总比滥情好 2020-12-24 12:53

So, there are

  • mongodb-csharp
  • simple-mongodb
  • NoRM

as C# drivers for MongoDB available.

Which one of them is the most m

相关标签:
7条回答
  • 2020-12-24 13:17

    A couple reasons to avoid the mongodb-csharp driver:

    1. It doesn't support "or" logic.
    2. It doesn't seem to support geospatial queries, at least we were not able to get it working.
    0 讨论(0)
  • 2020-12-24 13:17

    There is a performance issue in typed builders (Update<>, Query<>) of official 10gen C# driver. See How to speed up typed builders in 10gen official MongoDB C# driver?

    0 讨论(0)
  • 2020-12-24 13:26

    You should use MongoDB.Driver from this nuget package.

    You can view the full tutorials for the MongoC# example looking at this video https://www.youtube.com/watch?v=6x0-vHHHpv8

    0 讨论(0)
  • 2020-12-24 13:30

    For all curious out there. The best combination at this point seems to be official 10gen C# driver combined with fluent-mongo for Linq support:

    https://github.com/mongodb/mongo-csharp-driver

    https://github.com/craiggwilson/fluent-mongo

    Update: with release 1.4 of official C# driver, there'll be no need in fluent-mongo anymore.

    0 讨论(0)
  • 2020-12-24 13:32

    I'd go with Sam Corder’s mongodb-csharp. Also checkout this article.

    0 讨论(0)
  • 2020-12-24 13:33

    Since this question was answered 10gen have released an official MongoDB C# driver, and although it isn't the most mature C# driver in terms of age, with 10gen behind it it may end up as the most up to date.

    It is more low level than the mongodb-csharp driver (no Linq support at the moment) but we haven't found that to be a problem. We moved to the official driver from mongodb-csharp recently on a project (that isn't in production yet) for the following reasons:

    • Replica Set support in an official release
    • SafeMode allows you to specify how many servers a write must be replicated to
    • The driver handles connecting/disconnecting to the database
    • We're hoping that as an official driver, it will have more developer support
    0 讨论(0)
提交回复
热议问题