Skip to main content
Very Popular
Latest
method Collection.prototype.replaceOne
import { Collection } from "https://deno.land/x/mongo@v0.33.0/src/collection/mod.ts";

Replace a single document matching the given filter

Parameters

filter: Filter<T>

The query used to match the document

replacement: InsertDocument<T>

The replacement document

optional
options: UpdateOptions

Additional options for the operation

Returns

Promise<{ upsertedId: ObjectId | undefined; upsertedCount: number; matchedCount: number; modifiedCount: number; }>

The number of documents matched, modified, and upserted