[SERVER-480] figure out what to do with sorting by array sub-field Created: 12/Dec/09 Updated: 12/Jul/16 Resolved: 03/Jun/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance |
| Affects Version/s: | None |
| Fix Version/s: | 1.9.1 |
| Type: | Task | Priority: | Critical - P2 |
| Reporter: | Eliot Horowitz (Inactive) | Assignee: | Aaron Staple |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
the ensureIndex changes the output, which is bad. db.foo.drop() ] } ) ] } ) ] } ) ) ).forEach( printjson ); |
| Comments |
| Comment by auto [ 02/Jun/11 ] |
|
Author: {u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}Message: |
| Comment by auto [ 19/Apr/11 ] |
|
Author: {u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}Message: |
| Comment by Remon van Vliet [ 01/Apr/11 ] |
|
I agree that the indexed behaviour is the most intuitive solution and that the non-indexed implementation is the one that needs changing. I recently ran into this issue so I'm curious to see what the status is and how the expected implementation is going to work. |
| Comment by Eliot Horowitz (Inactive) [ 12/Dec/09 ] |
|
Right - that's what will happen if its indexed right now. |
| Comment by Valentin [ 12/Dec/09 ] |
|
db.foo.save( { a : [ { x : 2 }, { x : 3 } ] } ) , { x : 4 } ] } ) , { x : 2 } ] } ) ) ).forEach( printjson ); what do it sort? I think the most intuitive will be sorting by the biggest/the smallest of all of a.x (depending on sort direction). But It means what db.foo.find().sort( { "a.x" : 1 }) can be not equal to reversed db.foo.find().sort( { "a.x" : -1 }) I don't think it's a big deal, but it depends on how is sorting implemented |