aboutsummaryrefslogtreecommitdiff
path: root/node_modules/mongodb/lib/cursor.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/mongodb/lib/cursor.js')
-rw-r--r--node_modules/mongodb/lib/cursor.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/node_modules/mongodb/lib/cursor.js b/node_modules/mongodb/lib/cursor.js
index 9000847..f62b6d6 100644
--- a/node_modules/mongodb/lib/cursor.js
+++ b/node_modules/mongodb/lib/cursor.js
@@ -579,6 +579,20 @@ Cursor.prototype.batchSize = function(value) {
define.classMethod('batchSize', {callback: false, promise:false, returns: [Cursor]});
/**
+ * Set the collation options for the cursor.
+ * @method
+ * @param {object} value The cursor collation options
+ * @throws {MongoError}
+ * @return {Cursor}
+ */
+Cursor.prototype.collation = function(value) {
+ this.s.cmd.collation = value;
+ return this;
+}
+
+define.classMethod('collation', {callback: false, promise:false, returns: [Cursor]});
+
+/**
* Set the limit for the cursor.
* @method
* @param {number} value The limit for the cursor query.
@@ -779,7 +793,7 @@ define.classMethod('forEach', {callback: true, promise:false});
Cursor.prototype.setReadPreference = function(r) {
if(this.s.state != Cursor.INIT) throw MongoError.create({message: 'cannot change cursor readPreference after cursor has been accessed', driver:true});
if(r instanceof ReadPreference) {
- this.s.options.readPreference = new CoreReadPreference(r.mode, r.tags);
+ this.s.options.readPreference = new CoreReadPreference(r.mode, r.tags, {maxStalenessMS: r.maxStalenessMS});
} else if(typeof r == 'string'){
this.s.options.readPreference = new CoreReadPreference(r);
} else if(r instanceof CoreReadPreference) {
@@ -879,7 +893,7 @@ define.classMethod('toArray', {callback: true, promise:true});
/**
* Get the count of documents for this cursor
* @method
- * @param {boolean} applySkipLimit Should the count command apply limit and skip settings on the cursor or in the passed in options.
+ * @param {boolean} [applySkipLimit=true] Should the count command apply limit and skip settings on the cursor or in the passed in options.
* @param {object} [options=null] Optional settings.
* @param {number} [options.skip=null] The number of documents to skip.
* @param {number} [options.limit=null] The maximum amounts to count before aborting.