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

Method sort

src/cursor/find_cursor.ts:416–424  ·  view source on GitHub ↗

* Sets the sort order of the cursor query. * * @param sort - The key or keys set for the sort. * @param direction - The direction of the sorting (1 or -1).

(sort: Sort | string, direction?: SortDirection)

Source from the content-addressed store, hash-verified

414 * @param direction - The direction of the sorting (1 or -1).
415 */
416 sort(sort: Sort | string, direction?: SortDirection): this {
417 this.throwIfInitialized();
418 if (this.findOptions.tailable) {
419 throw new MongoTailableCursorError('Tailable cursor does not support sorting');
420 }
421
422 this.findOptions.sort = formatSort(sort, direction);
423 return this;
424 }
425
426 /**
427 * Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher)

Callers 15

searchtools.jsFile · 0.45
jquery.jsFile · 0.45
sortedFunction · 0.45
flaky.tsFile · 0.45
validateOutcomeFunction · 0.45
find.test.tsFile · 0.45
makeCursorFunction · 0.45
cursorSortFunction · 0.45

Calls 1

formatSortFunction · 0.90

Tested by 2

makeCursorFunction · 0.36
cursorSortFunction · 0.36