Optional includeIf true, include the similarity score in the result via the $similarity field.
See FindCursor.includeSimilarity for more details and examples.
Optional includeIf true, the sort vector will be available through await cursor.getSortVector() and await cursor.fetchNextPage().
See FindCursor.getSortVector for more details and examples.
Optional initialSets the starting page state for the cursor.
See FindCursor.initialPageState for more details and examples.
Optional limitThe maximum number of records to return in the lifetime of the cursor.
See FindCursor.limit for more details and examples.
Optional maxThis temporary error-ing property exists for migration convenience, and will be removed in a future version.
maxTimeMS option is no longer available; the timeouts system has been overhauled, and timeouts should now be set using timeout, and defaults in timeoutDefaults. You may generally Ctrl+R replace maxTimeMS with timeout to retain the same behavior.Optional projectionThe projection to apply to the returned records, to specify only a select set of fields to return.
See FindCursor.project for more details and examples.
Optional skipThe number of records to skip before starting to return records.
See FindCursor.skip for more details and examples.
Optional sortThe order in which to apply the update if the filter selects multiple records.
See FindCursor.sort for more details and examples.
Optional timeoutLets you specify timeouts for individual methods, in two different formats:
// Both `requestTimeoutMs` and `generalMethodTimeoutMs` are set to 1000ms.
await coll.insertOne({ ... }, { timeout: 1000 });
// `requestTimeoutMs` is left as default, `generalMethodTimeoutMs` is set to 2000ms.
await coll.insertOne({ ... }, { timeout: { generalMethodTimeoutMs: 2000 } });
// Both `requestTimeoutMs` and `generalMethodTimeoutMs` are set to 2000ms.
await coll.insertMany([...], {
timeout: { requestTimeoutMs: 2000, generalMethodTimeoutMs: 2000 },
});
// `requestTimeoutMs` is left as default, `generalMethodTimeoutMs` is set to 2000ms.
await coll.insertMany([...], { timeout: 2000 });
// `requestTimeoutMs` is left as default, `generalMethodTimeoutMs` is set to 2000ms.
await coll.insertMany([...], { timeout: { generalMethodTimeoutMs: 2000 } });
// Both `requestTimeoutMs` and `generalMethodTimeoutMs` are set to 2000ms.
await coll.insertMany([...], {
timeout: { requestTimeoutMs: 2000, generalMethodTimeoutMs: 2000 },
});
See TimeoutDescriptor for much more information.
TimeoutDescriptor
Optional vectorThis temporary error-ing property exists for migration convenience, and will be removed in a future version.
sort: { $vector: [...] } instead.Optional vectorizeThis temporary error-ing property exists for migration convenience, and will be removed in a future version.
sort: { $vectorize: '...' } instead.
Overview
The options for a generic
findcommand performed on the Data API.Example
Builder methods
You can also use fluent builder methods on the cursor:
Example
See