SurrealDB icon

SurrealDB

Interaction with a SurrealDB database

Relationship → Delete Relationship

AI-generated

Summary

Delete relationships in SurrealDB filtered by from record ID, relationship type, or to record ID. Returns data about the relationships affected based on the chosen return option.

Inputs

  • From Record ID — The ID of the source record of the relationship to delete, formatted as "table:id". Optional, but at least one of From Record ID, Relationship Type, or To Record ID must be provided.
  • Relationship Type — The type of relationship to delete, such as 'knows' or 'likes'. Optional, but at least one of From Record ID, Relationship Type, or To Record ID must be provided.
  • To Record ID — The ID of the target record of the relationship to delete, formatted as "table:id". Optional, but at least one of From Record ID, Relationship Type, or To Record ID must be provided.
  • Options — Additional options for the operation, including overriding the namespace and database, configuring what data to return after deletion (After, Before, Diff, None), and connection pooling settings.

Output shape

a record or array of records representing the relationship(s) deleted according to the 'Return' option selected ('After', 'Before', 'Diff', or 'None').

The output shape depends on the 'Return' option: 'After' returns records after deletion, 'Before' returns prior state, 'Diff' returns difference, and 'None' returns no data. At least one of From Record ID, Relationship Type, or To Record ID must be specified to identify the relationships to delete.

Links

Discussion