-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.3.1, 1.4.0
-
Component/s: None
-
None
-
Environment:Ubuntu Linux running inside VMWare server
If you use the word 'return' as an attribute name, or the word return is even part of any attribute name (like 'returned_date' or 'wesasreturningsa') then you will not be able to use the "$where" to filter on that attribute - you will get negative result (zero rows) under all circumstances, so "$where"=>"this.returned_date == null || this.returned_date != null" will still return zero rows, even though logically that is impossible. It may be some kind overly broad string matching in the mongo database's handling of "$where". You will not see this problem in a traditional filter or in the context of a map/reduce. To get around it without having to mangle your models, you can (unappetizingly) construct your where clause like this: "$where"=>"this['r' + 'eturned_date'] == 'whatever'"