C# driver version 1.4.1 released

42 views
Skip to first unread message

Robert Stam

unread,
Apr 17, 2012, 11:43:34 PM4/17/12
to mongodb-...@googlegroups.com, mongod...@googlegroups.com, mongodb...@googlegroups.com
Version 1.4.1 of the C# driver is now available.

This is a minor release intended to fix a few issues found in the first iteration of support for LINQ.

Note: the LINQ implementation has only been tested with C#. We plan to add unit tests for VB.NET as soon as possible.

The release notes are available online at:


The C# driver is available for download in source or binary form (.msi installer or .zip file) from:


Note: if you download the zip file, depending on how you unzip the file you may need to "Unblock" the help file. You can do so by right clicking on the "CSharpDriverDocs.chm" file and selecting Properties, and then clicking on the "Unblock" button. You will need to "Unblock" the help file if you see the message "Navigation to webpage was canceled" where the help text would normally appear.

The C# driver will also be available soon on NuGet at:


Online documentation is available at:


The online API reference documentation is available at:


Note: the online and API reference documentation will be updated to v1.4.1 over the next several days.

Bugs and suggestions can be submitted at:


Questions can be posted on the mongodb-user group:


We monitor this group and will be happy to answer any questions you post here.

Roman Kuzmin

unread,
Apr 18, 2012, 12:52:08 AM4/18/12
to mongod...@googlegroups.com, mongodb-...@googlegroups.com, mongodb...@googlegroups.com

Thank you for the new version.

 

> There are no breaking changes in this release.

There is a breaking change. It is mentioned in "Change Log v1.4.1-Bson.txt":

BsonDocument.cs

                changed SetDocumentId to assume Id is already of type BsonValue

 

Thus, when I call it with `int`, as I used to, then I get the exception:

Unable to cast object of type 'System.Int32' to type 'MongoDB.Bson.BsonValue'.

 

The method `SetDocumentId(object id)` is confusing now. It accepts `object id` but internally does:

var idBsonValue = (BsonValue)id;

 

This is unsafe and even not documented in code comments. Either this method should accept `BsonValue` or it should handle any suitable objects, as it did before.

 

Roman Kuzmin

unread,
Apr 18, 2012, 1:55:24 AM4/18/12
to mongod...@googlegroups.com, mongodb-...@googlegroups.com, mongodb...@googlegroups.com

Also, there is a bug.

 

\Driver\Builders\QueryBuilder.cs(1015):

public QueryConditionList In(IEnumerable<BsonValue> values)

 

It calls `if (values.Contains(null)) ...` with a null argument. At the same time in

 

\Bson\ObjectModel\BsonArray.cs(648):

public bool Contains(BsonValue value)

 

.. there is:

            if (value == null)

            {

                throw new ArgumentNullException("value");

            }

 

Thus, `In` seems to be always throwing an exception.

 

Adam C

unread,
Apr 18, 2012, 6:51:42 AM4/18/12
to mongod...@googlegroups.com, mongodb-...@googlegroups.com, mongodb...@googlegroups.com
Roman, have you filed this in the C# driver project?  

craiggwilson

unread,
Apr 18, 2012, 8:35:45 AM4/18/12
to mongod...@googlegroups.com, mongodb-...@googlegroups.com, mongodb...@googlegroups.com
Yes, he has filed them.  I'm looking into it.

Robert Stam

unread,
Apr 22, 2012, 9:56:21 PM4/22/12
to mongod...@googlegroups.com, mongodb-...@googlegroups.com, mongodb...@googlegroups.com
We have fixed the two issues raised by Roman Kuzmin. The related JIRA tickets are:


The issue with SetDocumentId caught us by surprise because we thought of SetDocumentId as an internal method. However, because the interface that defines SetDocumentId was not implemented privately it leaked out to the public API of the BsonDocument class. In the next point release we are temporarily changing the behavior of SetDocumentId back to match 1.4.0 and earlier for backward compatibility reasons, but at the same time we are marking these methods as obsolete and intend to make them private in a later release. The usual way of setting the _id field of a BsonDocument is:

    document["_id"] = value;

The issue with Query.In only occurs if you cast a BsonArray to IEnumerable<BsonValue> before calling Query.In, so there's a good chance you won't be affected by that either. See the JIRA ticket CSHARP-447 for sample code affected by this issue.

Even though both issues appear to be relatively minor and might not affect too many users, the probability of more users being affected is high enough that we are planning a 1.4.2 release in the coming week. Both known issues are currently fixed, and we simply want to wait a few more days to make sure there are no other minor issues that would be worth addressing in the 1.4.2 point release.

Thanks for the feedback, and please let us know if you have any other issues or questions.

Robert Stam
10gen

On Wednesday, April 18, 2012 8:

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/7wMPYYWPWVkJ.

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.

Reply all
Reply to author
Forward
0 new messages