We have fixed the two issues raised by Roman Kuzmin. The related JIRA
tickets are:
https://jira.mongodb.org/browse/CSHARP-446
https://jira.mongodb.org/browse/CSHARP-447
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:
On Wed, Apr 18, 2012 at 6:51 AM, Adam C <ad
...@10gen.com> wrote:
> Roman, have you filed this in the C# driver project?
> https://jira.mongodb.org/browse/CSHARP
> On Wednesday, April 18, 2012 6:55:24 AM UTC+1, Roman Kuzmin wrote:
>> 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.
> --
> 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 mongodb-user@googlegroups.com.
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.