Interface ClientReplaceOneModel<TSchema>

interface ClientReplaceOneModel<TSchema> {
    collation?: CollationOptions;
    filter: Filter<TSchema>;
    hint?: Hint;
    name: "replaceOne";
    namespace: string;
    replacement: WithoutId<TSchema>;
    upsert?: boolean;
}

Type Parameters

  • TSchema

Hierarchy (view full)

Properties

collation?: CollationOptions

Specifies a collation.

filter: Filter<TSchema>

The filter used to determine if a document should be replaced. For a replaceOne operation, the first match is replaced.

hint?: Hint

The index to use. If specified, then the query system will only consider plans using the hinted index.

name: "replaceOne"
namespace: string

The namespace for the write.

A namespace is a combination of the database name and the name of the collection: <database-name>.<collection>. All documents belong to a namespace.

replacement: WithoutId<TSchema>

The document with which to replace the matched document.

upsert?: boolean

When true, creates a new document if no document matches the query.