• Start

Languages

/

Mojo

/

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 <thing>;.

Method Syntax

client.delete(thing, session, txn)
ArgumentDescription
thingThe table or specific record to delete.
sessionAn optional session id.
txnAn 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?