Skip to content

Commit

Permalink
docs(cursor): incorrect returnKey documentation (#1734)
Browse files Browse the repository at this point in the history
It was unclear what type the 'returnKey' parameter
for cursor.returnKey should be and what it meant.

Fixes NODE-1182
  • Loading branch information
rweinberger authored Jun 11, 2018
1 parent 8b35113 commit 38213dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var push = Array.prototype.push;
* collection.find({}).max(10) // Set the cursor max
* collection.find({}).maxTimeMS(1000) // Set the cursor maxTimeMS
* collection.find({}).min(100) // Set the cursor min
* collection.find({}).returnKey(10) // Set the cursor returnKey
* collection.find({}).returnKey(true) // Set the cursor returnKey
* collection.find({}).setReadPreference(ReadPreference.PRIMARY) // Set the cursor readPreference
* collection.find({}).showRecordId(true) // Set the cursor showRecordId
* collection.find({}).sort([['a', 1]]) // Sets the sort order of the cursor query
Expand Down Expand Up @@ -350,9 +350,9 @@ Cursor.prototype.max = function(max) {
};

/**
* Set the cursor returnKey
* Set the cursor returnKey. If set to true, modifies the cursor to only return the index field or fields for the results of the query, rather than documents. If set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields.
* @method
* @param {object} returnKey Only return the index field or fields for the results of the query. If $returnKey is set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields. Use one of the following forms:
* @param {bool} returnKey the returnKey value.
* @return {Cursor}
*/
Cursor.prototype.returnKey = function(value) {
Expand Down

0 comments on commit 38213dc

Please sign in to comment.