[SERVER-2884] Array ordering semantics are different with index than without an index Created: 01/Apr/11  Updated: 12/Jul/16  Resolved: 03/Jun/11

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

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Aaron Staple
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

> db.c.save(

{a:[1,10]}

);
> db.c.save(

{a:5}

);
> db.c.find().sort(

{a:1}

)

{ "_id" : ObjectId("4d95731036d6ac4c79650e64"), "a" : 5 } { "_id" : ObjectId("4d95730836d6ac4c79650e63"), "a" : [ 1, 10 ] }

> db.c.find().sort(

{a:-1}

)

{ "_id" : ObjectId("4d95730836d6ac4c79650e63"), "a" : [ 1, 10 ] } { "_id" : ObjectId("4d95731036d6ac4c79650e64"), "a" : 5 }

> db.c.ensureIndex(

{a:1}

);
> db.c.find().sort(

{a:1}

)

{ "_id" : ObjectId("4d95730836d6ac4c79650e63"), "a" : [ 1, 10 ] } { "_id" : ObjectId("4d95731036d6ac4c79650e64"), "a" : 5 }

> db.c.find().sort(

{a:-1}

)

{ "_id" : ObjectId("4d95730836d6ac4c79650e63"), "a" : [ 1, 10 ] } { "_id" : ObjectId("4d95731036d6ac4c79650e64"), "a" : 5 }

>



 Comments   
Comment by auto [ 02/Jun/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-480 SERVER-2884 Perform in memory sorts by generating keys suitable for an index
Branch: master
https://github.com/mongodb/mongo/commit/70fbe10acfeb620022dd949a9ee9e90a3f683d32

Comment by auto [ 19/Apr/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-2884 test
Branch: master
https://github.com/mongodb/mongo/commit/acbc6b1fc443a0c262ab76a23e28bee627e8ec2e

Generated at Thu Feb 08 03:01:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.