const result = await collection.updateOne(
{ name: 'John' },
{ $set: { dob: new Date('1990-01-01'), updatedAt: { $currentDate: true } } },
{ upsert: true, sort: { $vector: [...] } },
);
See Collection's documentation for information on the available datatypes for collections.
See CollectionUpdateFilter's documentation for information on the available update operations.
Overview
The options for an
updateOne
command on a Collection.