• Start

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

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

Argument

Description

thing

The table or specific record to select.

session

An optional session id.

txn

An 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?