update()

Updates a given entity in the table, and returns the id of the updated entity.

An exception is thrown if the entity has not been inserted into the table before, e.g. if the primary key of the entity was not found.

// Increase the age of Alice
const aliceId = await update(userTable, { id: "alice-uuid", age: 16 });
Parameter Description
table The table created by createTable() .
item The item (or primary keys of an item + properties) to update.

Consider updateMany() if you want to update many items in parallel.

blinkDB © 2023