Interface ReplaceOneModel<TSchema>

Represents a replaceOne operation that can be used in a bulk write operation.

Field

filter - The filter to choose the document to replace.

Field

replacement - The replacement document, which contains no _id field.

Field

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

interface ReplaceOneModel<TSchema> {
    filter: Filter<TSchema>;
    replacement: NoId<TSchema>;
    upsert?: boolean;
}

Type Parameters

Properties

filter: Filter<TSchema>

The filter to choose the document to replace.

replacement: NoId<TSchema>

The replacement document, which contains no _id field.

upsert?: boolean

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

If false, do not insert if no documents match the filter.

Defaults to false.

Default Value

false