craiggwilson/fluent-mongo — Issue #45: Bug when using Conjunction and Disjunction
Author: ygrinevich
Created: 2011-12-05 11:51:29+00:00
State: open

When I execute the LINQ expression below

Collection.AsQueryable().Where(item => (item.FacebookId > 0 && item.FacebookId == user.FacebookId) || (item.Email == user.Email)).FirstOrDefault();
where user.FacebookId = 0, user.Email = "qwe@qwe.com"

the result query is: { "$or" : [{ "FacebookId" : NumberLong(0) }, { "Email" : "qwe@qwe.com" }] }
but should be: { "$or" : [{ "$and" : [{ "FacebookId" : { "$gt" : 0 } }, { "FacebookId" : NumberLong(0) }] }, { "Email" : "qwe@qwe.com" }] }

Does such LINQ expressions supported?

Thank you.