SurrealDB icon

SurrealDB

Interaction with a SurrealDB database

Record → Merge Record

AI-generated

Summary

Merge a set of fields into an existing SurrealDB record, creating or updating it as needed, specified by its record ID and optionally its table name.

Inputs

  • Table — SurrealDB table name (e.g., "person", "product"). Optional if Record ID includes a table prefix, which will be extracted automatically.
  • Record ID (required) — ID of the record, including or excluding the table prefix (e.g., "person:john" or "john"). If the Table field is empty, the table part will be extracted from this ID.
  • Data (JSON) (required) — Fields and values in JSON format to merge into the existing record's data.
  • Options — Optional overrides for namespace and database to use for the operation, instead of the default credential settings.
  • Connection Pooling — Settings to configure connection pooling parameters such as max connections, retry attempts, and validation timeouts to optimize performance.

Output shape

a single record representing the merged SurrealDB record's latest state after applying the merge data

The operation returns the updated record data in JSON format after merging. The table name can be inferred from the Record ID if not explicitly provided. Errors during merging are captured per item when processing multiple inputs.

Links

Discussion