[SERVER-738] Sorting on multiple keys when one is _id (when String) fails Created: 11/Mar/10  Updated: 12/Mar/10  Resolved: 12/Mar/10

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 1.3.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jamie Orchard-Hays Assignee: Eliot Horowitz (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS


Participants:

 Description   

Discovered to day that a sort on multiple fields fails when one is _id. In this case, I'm using a String as my _id, so it's relevant to sort on this field. Sorting just on _id or another fields works, but if I sort by another field and then _id, only _id sorting is performed. I compared with a multi-field sort not using _id (in this case "level" and "value_type") and this worked as expected: sorting occurred by level and then by value_type.

Sorts only by _id:
db.foo.find().sort(

{ some_key: 1, _id: 1}

)

Sorts properly by both keys:
db.foo.find().sort(

{ some_key: 1, another_key: 1}

)



 Comments   
Comment by Eliot Horowitz (Inactive) [ 12/Mar/10 ]

same as SERVER-438

Generated at Thu Feb 08 02:55:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.