.update()
Updates all records in a table, or a specific record, in the database.
Method Syntaxdb.update(thing, data)
NoteThis function replaces the current document / record data with the specified data.
Arguments | Description | ||
---|---|---|---|
thing required | The table name or the specific | ||
data optional | The document / record data to update. |
# Update all records in a table db.update('person', {name: "Jaime"}) # Update a record with a specific ID db.update(RecordID('person', 'tobie'), { "name": 'Tobie', "settings": { "active": True, "marketing": True, } })
This function will run the following query in the database.
UPDATE $thing CONTENT $data;