Type alias CollectionUpdateOneOptions

CollectionUpdateOneOptions: GenericUpdateOneOptions
Overview

The options for an updateOne command on a Collection.

Example

const result = await collection.updateOne(
{ name: 'John' },
{ $set: { dob: new Date('1990-01-01'), updatedAt: { $currentDate: true } } },
{ upsert: true, sort: { $vector: [...] } },
);

Datatypes

See Collection's documentation for information on the available datatypes for collections.


Update operations

See CollectionUpdateFilter's documentation for information on the available update operations.

See

  • Collection.updateOne
  • CollectionUpdateOneResult