[SERVER-1601] Sort parameter excludes any overlapping fields passed to find Created: 09/Aug/10 Updated: 12/Jul/16 Resolved: 10/Aug/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.6.0 |
| Fix Version/s: | 1.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Van Nguyen (vnguyen) | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
CentOS, OSX |
||
| Operating System: | Linux |
| Participants: |
| Description |
|
Ok, so we've found something that looks like it caused a lot of our production code to break. We are running a nightly build (to fix the getMore issue) of 1.6.x. We have replica sets running with 3 replicas which act as a single shard. Only one shard is running, all others are not yet enabled. We have a users collection where documents have two main keys or paths: 1) "key" which is a string We're running the following query* and an example result follows: > db.users.find({}, {"key":1, "account":1}).skip(0).limit(50).sort( {"account.created_at":-1}); , "key" : "xxxxxxxx" }
Account has many other subkeys that are not visible in the result of the find. Results of the explain query: ).skip(0).limit(50).sort( {"account.created_at":-1}).explain() , { "$minElement" : 1 } ] Interesting side case #1: > db.users.find({}, {"key":1, "account.username":1}).skip(0).limit(50).sort( {"account.created_at":1}); , "key" : "xxxxxx" } Interesting side case #2: ).skip(0).limit(50).sort({$natural:1});
Please let me know if additional information is needed. Thanks for your time. |
| Comments |
| Comment by Mathias Stearn [ 10/Aug/10 ] |
|
This should be solved if you build from master now. If not, please reopen. |
| Comment by auto [ 10/Aug/10 ] |
|
Author: {'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}Message: better adding of sort key to projection in mongos |