• Start

Languages

/

Mojo

/

Methods

select

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

Selects all records in a table, or a specific record. This is a convenience wrapper that runs SELECT * FROM <thing>;.

Method Syntax

client.select(thing, session, txn)
ArgumentDescription
thingThe table or specific record to select.
sessionAn optional session id.
txnAn optional transaction id.
# Select every record in a table
var people = client.select("person")

# Select a specific record
var chiru = client.select("person:chiru")
SELECT * FROM $thing;

Was this page helpful?