Interface GenericReplaceOneOptions

Represents the options for some generic replaceOne command.

Field

upsert - If true, perform an insert if no documents match the filter.

Field

sort - The sort order to pick which document to replace if the filter selects multiple documents.

Field

timeout - The timeout override for this method

interface GenericReplaceOneOptions {
    maxTimeMS?: "ERROR: The `maxTimeMS` option is no longer available; the timeouts system has been overhauled, and timeouts should now be set using `timeout`";
    sort?: Sort;
    timeout?: number | Pick<Partial<TimeoutDescriptor>, "requestTimeoutMs" | "generalMethodTimeoutMs">;
    upsert?: boolean;
    vector?: "ERROR: Use `sort: { $vector: [...] }` instead";
    vectorize?: "ERROR: Use `sort: { $vectorize: \"...\" }` instead";
}

Hierarchy (view full)

  • WithTimeout<"generalMethodTimeoutMs">
    • GenericReplaceOneOptions

Properties

maxTimeMS?: "ERROR: The `maxTimeMS` option is no longer available; the timeouts system has been overhauled, and timeouts should now be set using `timeout`"

This temporary error-ing property exists for migration convenience, and will be removed in a future version.

Deprecated

  • The 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.
sort?: Sort
timeout?: number | Pick<Partial<TimeoutDescriptor>, "requestTimeoutMs" | "generalMethodTimeoutMs">

The method timeout override.

See TimeoutDescriptor for much more information.

upsert?: boolean
vector?: "ERROR: Use `sort: { $vector: [...] }` instead"

This temporary error-ing property exists for migration convenience, and will be removed in a future version.

Deprecated

  • Use sort: { $vector: [...] } instead.
vectorize?: "ERROR: Use `sort: { $vectorize: \"...\" }` instead"

This temporary error-ing property exists for migration convenience, and will be removed in a future version.

Deprecated

  • Use sort: { $vectorize: '...' } instead.