[SERVER-8638] Allowed to build {<field>:0} index Created: 20/Feb/13 Updated: 08/Mar/13 Resolved: 20/Feb/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Trivial - P5 |
| Reporter: | Anton V. Volokhov | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | indexes | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
osx 10.8, ubuntu 12.10, ubuntu 10.10 |
||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Steps To Reproduce: |
1 db.some.insert( {a:1}) ) ).explain() ).explain() |
||||||||||||
| Participants: | |||||||||||||
| Description |
|
it is allowed to create an {a:0}index. This index has unexpected behavior with sorting > db.some.insert( {a:1}) ) ) { "_id" : ObjectId("51254055e6f520cff750a549"), "a" : 1 }> db.some.find().sort( {a:1}).explain() , { "$minElement" : 1 } ] ).explain() , { "$minElement" : 1 } ] |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 20/Feb/13 ] |
|
That creates an ascending index, as you can see. This is how it works now since we don't validate the order. There are other issues which describe this behavior and ask for better validation or for errors to be generated, for example. |