[SERVER-14459] Query with hint({$natural: -1}) returns documents in a forward order Created: 03/Jul/14  Updated: 07/Jul/14  Resolved: 07/Jul/14

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

Type: Bug Priority: Major - P3
Reporter: Jonathan Abrahams Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
duplicates SERVER-6979 hint with { $natural:-1 } returns doc... Closed
Operating System: ALL
Steps To Reproduce:

db.foo.ensureIndex({a:1});
var docNum=10;
for (var i=0; i< docNum; i++) {
   db.insert({a: Math.floor(Math.random()*docNum), b: i});
}
c.find({}).sort({$natural:-1})
c.find({}).hint({$natural:-1})

Participants:

 Description   

The query hint method, when specified with the $natural, always returns documents in a forward order. Note - the sort method works correctly.



 Comments   
Comment by Scott Hernandez (Inactive) [ 03/Jul/14 ]

dup of SERVER-6979

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