[SERVER-5014] $returnKey operator not implemented for getmore Created: 19/Feb/12  Updated: 28/Jan/15  Resolved: 28/Jan/15

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

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

Issue Links:
Duplicate
duplicates SERVER-10026 New query system Closed
Operating System: ALL
Participants:

 Description   

> c.save( {a:1} )
> c.save( {a:2} )
> c.save( {a:3} )
> c.ensureIndex( {a:1} )
> c.find().hint( {a:1} ).batchSize( 2 )._addSpecial( "$returnKey", true )
{ "a" : 1 }
{ "a" : 2 }
{ "_id" : ObjectId("4f40a6bb916db8388b2ba240"), "a" : 3 }
> 



 Comments   
Comment by David Storch [ 28/Jan/15 ]

Fixed in the new query system written for 2.6:

> db.version()
2.6.7
> c = db.c
test.c
> c.drop()
false
> c.insert({a: 1})
WriteResult({ "nInserted" : 1 })
> c.insert({a: 2})
WriteResult({ "nInserted" : 1 })
> c.insert({a: 3})
WriteResult({ "nInserted" : 1 })
> c.ensureIndex({a: 1})
{
	"createdCollectionAutomatically" : false,
	"numIndexesBefore" : 1,
	"numIndexesAfter" : 2,
	"ok" : 1
}
> c.find().hint({a: 1}).batchSize(2)._addSpecial("$returnKey", true)
{ "a" : 1 }
{ "a" : 2 }
{ "a" : 3 }

Closing as a duplicate of SERVER-10026.

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