Preview version 0.5 of a 10gen supported C# Driver for MongoDB available

19 views
Skip to first unread message

Robert Stam

unread,
Oct 15, 2010, 5:08:21 PM10/15/10
to mongod...@googlegroups.com
Dear MongoDB users,

We are pleased to announce the availability of the first preview release of a 10gen supported C# Driver for MongoDB.

Version 0.5 of the C# Driver is a high-performance, full-featured driver. It includes the following features:

* Fully compliant with .NET conventions
* High performance I/O layer (with buffer pooling to reduce GC overhead)
* High performance connection pooling
* Rich in-memory object model for BSON documents
* Serialization support for your C# classes (using custom, automatic, or attribute-based class maps)
* Serialization extensibility hooks allow you to write code to support unusual serialization requirements
* Support for converting documents to JSON (for debugging and interoperability)
* Thread-safety
* Support for RequestStart/RequestDone so a thread can temporarily reserve a connection for a series of related operations
* Support for connection strings
* Full support for authentication (efficiently integrated with connection pooling)
* Full support for replica sets (with parallel connection attempts to all servers on the seed list and support for fail-over)
* Full set of helper methods for database commands
* Full set of helper methods for collection operations
* Flexible control over SafeMode at various levels (server, database, collection, operation)
* Builder classes for: queries, fields, group by, index keys and options, map/reduce options, sort by and update modifiers
* Collections work with either BsonDocument or your C# classes
* Careful implementation of cursors to free resources as early as possible and reliably
* GridFS support
* Comprehensive tutorial available online

It is available for download in source or binary form from:

http://github.com/mongodb/mongo-csharp-driver
http://github.com/mongodb/mongo-csharp-driver/downloads

Online documentation is available at:

http://www.mongodb.org/display/DOCS/CSharp+Language+Center

Bugs and suggestions can be recorded at:

http://jira.mongodb.org/browse/CSHARP

We hope you enjoy using the new 10gen supported C# driver. We look forward to your feedback.

Robert Stam
Project Lead for the C# Driver

Stuart Johnson

unread,
Oct 16, 2010, 8:34:23 AM10/16/10
to mongod...@googlegroups.com
This is great news. There is a lot of confusion as to which C# driver
to use, especially in production. Non of the existing drivers have
stable replica set support yet which is a must have feature for a lot of
users now. This can become the core, and extensions such as LINQ could
be added on top.

> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.

Christian

unread,
Oct 16, 2010, 3:51:03 PM10/16/10
to mongodb-user
Yes, very great news.

I look forward to trying it out more.

However I ran into the same issue as Barry (http://jira.mongodb.org/
browse/CSHARP-71) after only 3 lines of test code on an existing
collection :)

I sure hope this is not the way it's supposed to work... hehe..

--
Christian Sparre

Justin Dearing

unread,
Oct 16, 2010, 7:14:16 PM10/16/10
to mongod...@googlegroups.com

Can you make a unit test for that? Robert has a pretty good test suite and we should add more to cover what is broken.

Al Tenhundfeld

unread,
Oct 17, 2010, 11:30:00 AM10/17/10
to mongodb-user
This may be a stupid question. How does this relate to NoRM?
http://github.com/atheken/NoRM

Obviously they are separate projects, but in my circle, NoRM is the de
facto standard library for using MongoDB from .NET. And I've been very
happy with it. From my narrow perspective as a C# developer trying to
get things done, it would be better for 10gen to contribute to NoRM
and mature it, rather than spend effort on a separate full driver
implementation.

In your longterm vision, do you see this driver as an alternative to
libraries like NoRM, or do you see an ecosystem of higher level
libraries, like the object mapping and LINQ provider parts of NoRM,
built on top of this official "10gen supported" driver?

cheers,
Al

On Oct 16, 7:14 pm, Justin Dearing <zippy1...@gmail.com> wrote:
> Can you make a unit test for that? Robert has a pretty good test suite and
> we should add more to cover what is broken.
> On Oct 16, 2010 4:53 PM, "Christian" <spar...@gmail.com> wrote:> Yes, very great news.
>
> > I look forward to trying it out more.
>
> > However I ran into the same issue as Barry (http://jira.mongodb.org/
> > browse/CSHARP-71) after only 3 lines of test code on an existing
> > collection :)
>
> > I sure hope this is not the way it's supposed to work... hehe..
>
> > --
> > Christian Sparre
>
> > --
> > You received this message because you are subscribed to the Google Groups
>
> "mongodb-user" group.> To post to this group, send email to mongod...@googlegroups.com.
> > To unsubscribe from this group, send email to
>
> mongodb-user...@googlegroups.com<mongodb-user%2Bunsubscribe@google groups.com>
> .> For more options, visit this group at
>
> http://groups.google.com/group/mongodb-user?hl=en.
>
>
>
>
>
>
>
>

Eliot Horowitz

unread,
Oct 17, 2010, 9:19:16 PM10/17/10
to mongod...@googlegroups.com
I think its the second. So things like NoRM can be built on top of
the official underpinning.
No reason to have multiple versions of the bson/network layer, and
then we can optimize it a lot, and also make sure its consistent with
other languages.

> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.

Justin Dearing

unread,
Oct 17, 2010, 9:33:25 PM10/17/10
to mongodb-user
On Sun, Oct 17, 2010 at 9:19 PM, Eliot Horowitz <elioth...@gmail.com> wrote:
I think its the second.  So things like NoRM can be built on top of
the official underpinning.
No reason to have multiple versions of the bson/network layer, and
then we can optimize it a lot, and also make sure its consistent with
other languages.

Agreed, although it would be really awesome longterm if BSON became adopted outside of mongo to the point of  language maintainers implementing it in the core SDKs. I'd like to see Mongo.Bson deprecated for System.Bson in .NET.

Justin

Christian

unread,
Oct 18, 2010, 4:04:27 AM10/18/10
to mongodb-user
I like that idea

Sometimes its nice to work with LINQ an strongly typed classes like in
NoRM, but sometimes it's much more flexible to work with a list of
keys and values especially when designing an API to be used across
platforms etc.

And the 10gen driver seems to work pretty well already, I'm still
amazed by the speed of MongoDB and how easy it is to get a project
going.

Maybe I haven't found it in the new driver yet, but you can call
ToJson() on a BsonDocument, I would like to see an option to get a
BsonDocumet from a Json string :)

--
Christian

Robert Stam

unread,
Oct 19, 2010, 10:25:02 AM10/19/10
to mongodb-user
http://jira.mongodb.org/browse/CSHARP-71 is fixed. Thanks for the bug
report. I've added some more unit tests to verify that similar
situations were working correctly.

Parsing JSON will be there soon.

Robert Stam

unread,
Oct 21, 2010, 7:48:25 PM10/21/10
to mongodb-user
Just a heads up on some naming changes that will affect you if you are
getting the latest version of the code from the repository.

The following namespaces have been changed from:

using MongoDB.BsonLibrary;
using MongoDB.CSharpDriver;

to

using MongoDB.Bson;
using MongoDB.Driver;

It was pointed out to me that "Library" was redundant, and "CSharp"
was an implementation detail and that VB users might not appreciate
that detail polluting their namespace! :-)

Also, the Bson class had to be renamed to BsonConstants because a
class can't have the same name as the namespace it is in (so if you
were using Bson.Null it is now BsonConstants.Null).

There are similar changes to the names of the DLLs themselves, so you
should drop your references to the old DLLs and add references to the
new names.

I will be updating the online tutorial tonight to reflect these
changes.

Hopefully we will get all these breaking name improvements out of the
way while we are still in the preview stage. If you see any other
problematic names please speak up!

On Oct 19, 10:25 am, Robert Stam <rstam10...@gmail.com> wrote:
> http://jira.mongodb.org/browse/CSHARP-71is fixed. Thanks for the bug
> report. I've added some more unit tests to verify that similar
> situations were working correctly.
>
> Parsing JSON will be there soon.
>
> On Oct 18, 4:04 am, Christian <spar...@gmail.com> wrote:
>
> > I like that idea
>
> > Sometimes its nice to work with LINQ an strongly typed classes like in
> > NoRM, but sometimes it's much more flexible to work with a list of
> > keys and values especially when designing an API to be used across
> > platforms etc.
>
> > And the10gendriverseems to work pretty well already, I'm still
> > amazed by the speed of MongoDB and how easy it is to get a project
> > going.
>
> > Maybe I haven't found it in the newdriveryet, but you can call

Andrew Rondeau

unread,
Oct 28, 2010, 6:00:02 PM10/28/10
to mongodb-user
I noticed that MongoDB.Bson conflicts with Sam's driver. The only
reason why I bring this up is that I'm currently converting to the
official driver "one module at a time," and will be using both drivers
in parallel for a short period of time. I suspect that other people
may take the same approach. The official driver isn't exactly a drop-
in replacement for Sam's driver, and thus switching isn't a trivial
task.

May I suggest MongoDB.BSON? The capitalization difference will be
enough so we don't have to do everything at once?

- Andy

On Oct 21, 4:48 pm, Robert Stam <rstam10...@gmail.com> wrote:
> Just a heads up on some naming changes that will affect you if you are
> getting the latest version of the code from the repository.
>
> The following namespaces have been changed from:
>
> using MongoDB.BsonLibrary;
> using MongoDB.CSharpDriver;
>
> to
>
> using MongoDB.Bson;
> using MongoDB.Driver;
>
> It was pointed out to me that "Library" was redundant, and "CSharp"
> was an implementation detail and that VB users might not appreciate
> that detail polluting their namespace! :-)
>
> Also, the Bson class had to be renamed to BsonConstants because a
> class can't have the same name as the namespace it is in (so if you
> were using Bson.Null it is now BsonConstants.Null).
>
> There are similar changes to the names of the DLLs themselves, so you
> should drop your references to the old DLLs and add references to the
> new names.
>
> I will be updating the online tutorial tonight to reflect these
> changes.
>
> Hopefully we will get all these breaking name improvements out of the
> way while we are still in the preview stage. If you see any other
> problematic names please speak up!
>
> On Oct 19, 10:25 am, Robert Stam <rstam10...@gmail.com> wrote:
>
>
>
>
>
>
>
> >http://jira.mongodb.org/browse/CSHARP-71isfixed. Thanks for the bug

craiggwilson

unread,
Oct 28, 2010, 6:26:04 PM10/28/10
to mongodb-user
You can set a default global alias for sam's driver and then alias
them in the usings.

Robert Stam

unread,
Oct 29, 2010, 12:04:26 AM10/29/10
to mongodb-user
I can't see us going against .NET naming conventions for short term
reasons... Sorry.
Reply all
Reply to author
Forward
0 new messages