[DOCS-5901] Document new DBQuery helper methods in the shell Created: 24/Jul/15  Updated: 11/Jan/17  Resolved: 11/Dec/15

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Task Priority: Major - P3
Reporter: David Storch Assignee: Ravind Kumar (Inactive)
Resolution: Done Votes: 0
Labels: docs-3.2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 8 years, 9 weeks, 2 days ago

 Description   

The returnKey and maxScan options to find are passed using a different format for legacy OP_QUERY find and the find command (new in 3.2). Therefore, passing a literal $returnKey or $maxScan as part of the argument to a .find() is no longer supported in the shell:

./mongo --readMode commands
> db.c.drop()
> db.c.insert({})
> db.c.find({$query: {}, $maxScan: 5})
assert: command failed: {
	"waitedMS" : NumberLong(0),
	"ok" : 0,
	"errmsg" : "unknown top level operator: $query",
	"code" : 2
}

Commit ffdb57ed20b introduced cursor.returnKey() and cursor.maxScan() helpers, which are now the official way to set these options. In the 3.2 manual, we should replace the $returnKey documentation (http://docs.mongodb.org/manual/reference/operator/meta/returnKey/) with a page documenting the cursor.returnKey() method. Similarly, we should replace http://docs.mongodb.org/manual/reference/operator/meta/maxScan/ with a page documenting the cursor.maxScan() method.



 Comments   
Comment by Githook User [ 14/Dec/15 ]

Author:

{u'username': u'rkumar-mongo', u'name': u'ravind', u'email': u'ravind.kumar@10gen.com'}

Message: DOCS-5901 : Adding missing comment-param file

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/01dc8b1fd4d2cfccf8c67851f86f6f3be3ac9ae1

Comment by Githook User [ 10/Dec/15 ]

Author:

{u'username': u'rkumar-mongo', u'name': u'ravind', u'email': u'ravind.kumar@10gen.com'}

Message: DOCS-5901 : Creating new cursor methods

Round 3:

  • More CR refinements

Round 2:

  • CR changes

Round 1:

  • Created cursor.maxScan()
  • Created cursor.returnKey()
  • Created cursor.tailable()
  • Created cursor.comment()

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/85ce0039e6411cc2301c4cbf471da9b868e8d793

Comment by David Storch [ 02/Dec/15 ]

We also need to document the new .tailable() helper method.

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