You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param {object} maxScan Constrains the query to only scan the specified number of documents when fulfilling the query
258
+
* @return {Cursor}
259
+
*/
260
+
Cursor.prototype.maxScan=function(maxScan){
261
+
if(this.s.state==Cursor.CLOSED||this.s.state==Cursor.OPEN||this.isDead())thrownewMongoError("Cursor is closed");
262
+
this.s.cmd.maxScan=maxScan;
263
+
returnthis;
264
+
}
265
+
266
+
/**
267
+
* Set the cursor hint
268
+
* @method
269
+
* @param {object} hint If specified, then the query system will only consider plans using the hinted index.
270
+
* @return {Cursor}
271
+
*/
272
+
Cursor.prototype.hint=function(hint){
273
+
if(this.s.state==Cursor.CLOSED||this.s.state==Cursor.OPEN||this.isDead())thrownewMongoError("Cursor is closed");
274
+
this.s.cmd.hint=hint;
275
+
returnthis;
276
+
}
277
+
278
+
/**
279
+
* Set the cursor min
280
+
* @method
281
+
* @param {object} min Specify a $min value to specify the inclusive lower bound for a specific index in order to constrain the results of find(). The $min specifies the lower bound for all keys of a specific index in order.
282
+
* @return {Cursor}
283
+
*/
284
+
Cursor.prototype.min=function(min){
285
+
if(this.s.state==Cursor.CLOSED||this.s.state==Cursor.OPEN||this.isDead())thrownewMongoError("Cursor is closed");
286
+
this.s.cmd.min=min;
287
+
returnthis;
288
+
}
289
+
290
+
/**
291
+
* Set the cursor max
292
+
* @method
293
+
* @param {object} max Specify a $max value to specify the exclusive upper bound for a specific index in order to constrain the results of find(). The $max specifies the upper bound for all keys of a specific index in order.
294
+
* @return {Cursor}
295
+
*/
296
+
Cursor.prototype.max=function(max){
297
+
if(this.s.state==Cursor.CLOSED||this.s.state==Cursor.OPEN||this.isDead())thrownewMongoError("Cursor is closed");
298
+
this.s.cmd.max=max;
299
+
returnthis;
300
+
}
301
+
302
+
/**
303
+
* Set the cursor returnKey
304
+
* @method
305
+
* @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:
306
+
* @return {Cursor}
307
+
*/
308
+
Cursor.prototype.returnKey=function(value){
309
+
if(this.s.state==Cursor.CLOSED||this.s.state==Cursor.OPEN||this.isDead())thrownewMongoError("Cursor is closed");
310
+
this.s.cmd.returnKey=value;
311
+
returnthis;
312
+
}
313
+
314
+
/**
315
+
* Set the cursor showRecordId
316
+
* @method
317
+
* @param {object} showRecordId The $showDiskLoc option has now been deprecated and replaced with the showRecordId field. $showDiskLoc will still be accepted for OP_QUERY stye find.
318
+
* @return {Cursor}
319
+
*/
320
+
Cursor.prototype.showRecordId=function(value){
321
+
if(this.s.state==Cursor.CLOSED||this.s.state==Cursor.OPEN||this.isDead())thrownewMongoError("Cursor is closed");
322
+
this.s.cmd.showDiskLoc=value;
323
+
returnthis;
324
+
}
325
+
326
+
/**
327
+
* Set the cursor snapshot
328
+
* @method
329
+
* @param {object} snapshot The $snapshot operator prevents the cursor from returning a document more than once because an intervening write operation results in a move of the document.
330
+
* @return {Cursor}
331
+
*/
332
+
Cursor.prototype.snapshot=function(value){
333
+
if(this.s.state==Cursor.CLOSED||this.s.state==Cursor.OPEN||this.isDead())thrownewMongoError("Cursor is closed");
0 commit comments