craiggwilson / fluent-mongo

Provides a fluent interface on top of the 10gen driver including Linq.
172 stars 28 forks source link

Problems with booleans #19

Closed couellet closed 13 years ago

couellet commented 13 years ago

I got a problem this morning with booleans.

db.GetCollection("Person").AsQueryable() .Where(x => !x.Active) .ToList()

It returns nothing when it should, but if I do:

db.GetCollection("Person").AsQueryable() .Where(x => x.Active == false) .ToList()

It works!

This is certainly not an urgency, but it can cause some headaches ;)

My version of FluentMongo is 1.0.1.1

craiggwilson commented 13 years ago

This is the same issue another just raised about $not being placed in the wrong position. I'm going to try a hack to fix this...

nekresh commented 13 years ago

I've issued a pull request for this problem (https://github.com/craiggwilson/fluent-mongo/pull/20) I consider a not followed by a field to be the same as field == false

craiggwilson commented 13 years ago

I have merged in nekresh's pull request.