* Set the limit for the cursor. * * @param value - The limit for the cursor query.
(value: number)
| 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. |
no outgoing calls