[CSHARP-1912] Filter builder.And(<emptyFilter>,<emptyFilter>) renders incorrectly Created: 09/Feb/17  Updated: 13/Feb/17  Resolved: 13/Feb/17

Status: Closed
Project: C# Driver
Component/s: API, Operations
Affects Version/s: 2.4.2
Fix Version/s: 2.4.3

Type: Bug Priority: Major - P3
Reporter: Chad Kreimendahl Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CSHARP-1291 And and Or filter builder methods sho... Closed

 Description   

Quick note. This problem arose in an upgrade from 2.2 to 2.4.2.

When doing the following:

SomeMethod

  var filt1 = Builders<Thing>.Filter.Empty;
  var filt2 = Builders<Thing>.Filter.Empty;
  var filter = Builders<Thing>.Filter.And(filt1,filt2);

The rendered "filter" from above is an empty (and illegal) $and:

{[]}

in version 2.2, this would render as empty.



 Comments   
Comment by Githook User [ 13/Feb/17 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1912: And with one or more empty clauses rendering incorrectly.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/5045d428e728f79d9f8a75aa25d9d3085543a73d

Comment by Robert Stam [ 09/Feb/17 ]

You are correct. It should render as empty.

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