[SERVER-6899] Inability to find a document in the collection, if the find-query containes the fields not in the same order as they are in the collection. Created: 30/Aug/12 Updated: 15/Feb/13 Resolved: 30/Aug/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying, Shell |
| Affects Version/s: | 2.0.7 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Alexander | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | find, query | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu 12.04 LTS 32 bit |
||
| Operating System: | Linux |
| Participants: |
| Description |
|
Example: > db.testCol.insert({fish: {name: 'Arctic fish', desciption: 'I like cold water!'}}) And now we a going to find our recond. } But if we define fields in other order, mongo can't find our record. ) |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 30/Aug/12 ] | |
|
You want to use dot-notation because the document is compared as a whole, not in parts nor out of order.
http://www.mongodb.org/display/DOCS/Dot+Notation+(Reaching+into+Objects) |