SurrealDB icon

SurrealDB

Interaction with a SurrealDB database

Record → Update Record

AI-generated

Summary

Update a record in a SurrealDB database by either replacing the entire record or updating specific fields using SET operations.

Inputs

  • Table — SurrealDB table name (e.g., "person", "product"). Optional if Record ID includes a table prefix. If a full record ID is provided (e.g., "person:john"), the table part will be extracted automatically.
  • Record ID (required) — ID of the record to update. Can include table prefix (e.g., "person:john", "product:abc123"). If the Table field is empty, the table part is extracted from the Record ID.
  • Update Mode (required) — Determines the update behavior: either replace the entire record ("replace") or update specific fields using SurrealDB SET syntax ("set").
  • Data (JSON) (required) — JSON data to replace the entire record with. Required when Update Mode is "replace".
  • SET Operations (required) — Defines one or more SET operations to perform on the record. Each operation specifies a field, an operator (=, +=, + =, -=), and a value (stringified JSON) to apply. Required when Update Mode is "set".
  • Options — Additional optional parameters to override the credential namespace and database for the operation.
  • Connection Pooling — Optional settings to configure connection pooling behavior for improved performance.

Output shape

a JSON object representing the updated record as returned by SurrealDB

The node returns the updated record data on success. If an operation fails for an item, the error details are included in the workflow output. The operation supports processing multiple input items independently.

Examples

Example 1: Replace entire record

Specify the Record ID and provide the full record data in JSON for replacement. Leave the Table field empty if the Record ID includes the table prefix. Set Update Mode to 'Replace Record'. Output will be the fully replaced record.

Example 2: Update specific fields

Specify the Record ID and define one or more SET operations to selectively update fields. Use field names and operators to adjust values. Set Update Mode to 'Set Fields'. Output will be the record after field updates.

Links

Discussion