NotDatabase
Docs
Use update()
to modify an existing document by its ID. Only the fields you pass will be updated — the rest stay untouched.
update()
await db.users.update("user_gilfoyle", {
name: "Bertram Gilfoyle",
isAdmin: true,
});
This updates just the name
and isAdmin
fields of the document with _id: "user_gilfoyle"
.
updatedAt
is automatically updated for you.