[CSHARP-47] Incorrectly resolved boolean expressions in linq projections Created: 27/Jun/10  Updated: 19/Oct/16  Resolved: 27/Jun/10

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

Type: Bug Priority: Major - P3
Reporter: Attila Kisko Assignee: Craig Wilson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Client is built from git commit 3a68dc116f5e320709c8.
Data object:

class Foo
{
[MongoAlias("bar")]
public int Bar

{ get; set; }
[MongoAlias("ispublic")]
public bool Public { get; set; }

}

The following query fails to produce results:

var coll = db.GetCollection<Foo>("foo");
coll.Linq().Count(f => f.Public && f.Bar > 50);

After db.setProfilingLevel(2):

> db.system.profile.find()
{ "ts" : "Sun Jun 27 2010 23:16:07 GMT+0200 (CEST)", "info" : "query tempdb.$cmd ntoreturn:1 command: { count: \"foo\", query: { ispublic: { Bar:

{ $gt: 50 }

} } } reslen:57 bytes:41", "millis" : 0 }

If i rewrite the query, it works properly:

coll.Linq().Count(f => f.Public == true && f.Bar > 50);

> db.system.profile.find()
{ "ts" : "Sun Jun 27 2010 23:26:47 GMT+0200 (CEST)", "info" : "query tempdb.$cmd ntoreturn:1 command: { count: \"foo\", query: { ispublic: true, bar:

{ $gt: 50 }

} } reslen:57 bytes:41", "millis" : 0 }



 Comments   
Comment by Craig Wilson [ 27/Jun/10 ]

This has been fixed.

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