FindOneAndModifyOptions: FindOneOptions & {
    returnNewDocument?: boolean;
    upsert?: boolean;
}

Options passed when finding and modifying a single document

Type declaration

  • Optional Readonly returnNewDocument?: boolean

    Optional. Default: false. A boolean that, if true, indicates that the action should return the document in its updated form instead of its original, pre-update form.

  • Optional Readonly upsert?: boolean

    Optional. Default: false. A boolean that, if true, indicates that MongoDB should insert a new document that matches the query filter when the query does not match any existing documents in the collection.

Generated using TypeDoc