.merge()
Modifies all records in a table, or a specific record, in the database.
Method Syntaxdb.merge(thing, data)
NoteThis function merges the current document / record data with the specified data. If no merge data is passed it will simply trigger an update.
Arguments | Description | ||
---|---|---|---|
thing required | The table name or the specific | ||
data optional | The document / record data to merge. |
# Update all records in a table await db.merge('person', { updated_at: datetime.datetime.utcnow() }) # Update a record with a specific ID await db.merge(RecordID('person', 'tobie'), { "updated_at": datetime.datetime.utcnow(), "settings": { "active": true, } })
This function will run the following query in the database.
UPDATE $thing MERGE $data;