[SERVER-1566] Weird result with sort({$natural:-1}) Created: 04/Aug/10  Updated: 17/Mar/11  Resolved: 16/Jan/11

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

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

The {$natural:1} results are correct

> db.foo.find({}).sort({$natural:-1}).itcount()
500463
> db.foo.find({}).sort({$natural:1}).itcount()
647227
> db.foo.find({}).sort({$natural:-1}).explain()
{
"cursor" : "ReverseCursor",
"nscanned" : 500463,
"nscannedObjects" : 500463,
"n" : 500463,
"millis" : 151,
"indexBounds" : {

}
}
> db.foo.find({}).sort({$natural:1}).explain()
{
"cursor" : "BasicCursor",
"nscanned" : 647227,
"nscannedObjects" : 647227,
"n" : 647227,
"millis" : 194,
"indexBounds" : {

}
}



 Comments   
Comment by Eliot Horowitz (Inactive) [ 04/Aug/10 ]

can re-assign back to me when you have a test/or more info

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