Skip to main content
Extremely Popular
Go to Latest
method Collection.prototype.findAndModify
import { Collection } from "https://deno.land/x/mongo@v0.31.0/mod.ts";

Find and modify a document in one, returning the matching document.

Parameters

optional
filter: Filter<T>

The query used to match documents

optional
options: FindAndModifyOptions<T>

Additional options for the operation (e.g. containing update or remove parameters)

Returns

Promise<T | undefined>

The document matched and modified