[CSHARP-381] Document and/or modify the behavior of Query.EQ when value is C# null Created: 12/Jan/12  Updated: 02/Apr/15  Resolved: 06/Feb/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.3.1
Fix Version/s: 1.4

Type: Bug Priority: Minor - P4
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change

 Description   

See: http://groups.google.com/group/mongodb-user/browse_thread/thread/8a8131a6af1daf60

As a result of BsonDocument functional construction ignoring C# nulls (just like XDocument), the result of the following query builder expression can be surprising:

Query.EQ("x", null) => {}

This either needs to be documented more thoroughly, or if we choose to disallow this then Query.EQ should throw an ArgumentNullException.



 Comments   
Comment by Robert Stam [ 06/Feb/12 ]

The Query builder methods now check arguments for null and throw an exception when called with invalid arguments.

This is only a breaking change if you were relying on the undocumented (and inconsistent) behavior of certain methods when passed nulls.

Generated at Wed Feb 07 21:36:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.