Interface GenericFindOneOptions

Represents the options for some generic findOne command.

Field

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

Field

projection - Specifies which fields should be included/excluded in the returned documents.

Field

includeSimilarity - If true, include the similarity score in the result via the $similarity field.

Field

timeout - The timeout override for this method

interface GenericFindOneOptions {
    includeSimilarity?: boolean;
    projection?: Projection;
    sort?: Sort;
    timeout?: number | Pick<Partial<TimeoutDescriptor>, "requestTimeoutMs" | "generalMethodTimeoutMs">;
}

Hierarchy (view full)

  • WithTimeout<"generalMethodTimeoutMs">
    • GenericFindOneOptions

Properties

includeSimilarity?: boolean

If true, include the similarity score in the result via the $similarity field.

projection?: Projection

The projection to apply to the returned records, to specify only a select set of fields to return.

If using a projection, it is heavily recommended to provide a custom type for the returned records as a generic typeparam to the find method.

sort?: Sort

The order in which to apply the update if the filter selects multiple records.

Defaults to null, where the order is not guaranteed.

timeout?: number | Pick<Partial<TimeoutDescriptor>, "requestTimeoutMs" | "generalMethodTimeoutMs">

The method timeout override.

See TimeoutDescriptor for much more information.