• Start

Methods

update

The update() method for the SurrealDB Mojo SDK updates all records in a table, or a specific record.

Updates all records in a table, or a specific record, replacing their content. This is a convenience wrapper that runs `UPDATE CONTENT ;`.

Method Syntax
client.update(thing, content_json, session, txn)

Argument

Description

thing

The table or specific record to update.

content_json

The replacement content as a JSON string.

session

An optional session id.

txn

An optional transaction id.

var resp = client.update("person:chiru", '{ "age": 31 }')
UPDATE $thing CONTENT $content_json;

Was this page helpful?