• Start

Methods

delete

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

Deletes all records in a table, or a specific record. This is a convenience wrapper that runs `DELETE ;`.

Method Syntax
client.delete(thing, session, txn)

Argument

Description

thing

The table or specific record to delete.

session

An optional session id.

txn

An optional transaction id.

# Delete a specific record
var resp = client.delete("person:chiru")

# Delete every record in a table
var cleared = client.delete("person")
DELETE $thing;

Was this page helpful?