MCPcopy
hub / github.com/mongodb/node-mongodb-native / limit

Method limit

src/cursor/find_cursor.ts:465–477  ·  view source on GitHub ↗

* Set the limit for the cursor. * * @param value - The limit for the cursor query.

(value: number)

Source from the content-addressed store, hash-verified

463 * @param value - The limit for the cursor query.
464 */
465 limit(value: number): this {
466 this.throwIfInitialized();
467 if (this.findOptions.tailable) {
468 throw new MongoTailableCursorError('Tailable cursor does not support limit');
469 }
470
471 if (typeof value !== 'number') {
472 throw new MongoInvalidArgumentError('Operation "limit" requires an integer');
473 }
474
475 this.findOptions.limit = value;
476 return this;
477 }
478
479 /**
480 * Set the skip for the cursor.

Callers 13

scheduleWorkloadFunction · 0.45
find.test.tsFile · 0.45
makeCursorFunction · 0.45
finishedFunction · 0.45
node_csot.test.tsFile · 0.45
cursor.test-d.tsFile · 0.45
findOneMethod · 0.45

Calls

no outgoing calls

Tested by 2

makeCursorFunction · 0.36
finishedFunction · 0.36