[SERVER-864] $where queries involving an attribute with the word "return" anywhere in the name returns nothing Created: 02/Apr/10 Updated: 12/Jul/16 Resolved: 08/Apr/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.3.1, 1.4.0 |
| Fix Version/s: | 1.5.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Patrick Gannon | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu Linux running inside VMWare server |
||
| Participants: |
| Description |
|
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'" |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 26/Apr/10 ] |
|
in a release |
| Comment by auto [ 08/Apr/10 ] |
|
Author: {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}Message: fix where on v8 |
| Comment by Aaron Staple [ 08/Apr/10 ] |
|
seems to be failing in v8? |
| Comment by auto [ 02/Apr/10 ] |
|
Author: {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}Message: make return parsing smarter |
| Comment by Eliot Horowitz (Inactive) [ 02/Apr/10 ] |
|
will fix, but if you make it then it will work as is |