Limit
Many times you will want to limit the number of results returned by a query. To do this, you can use the Limit
method.
For example, the following query will return the 10 most recently created users.
const query = client
.query('users')
.Select(['id', 'name', 'email', 'dob'])
.Order('created_at', 'DESC')
.Limit(10);
As a convenience, Triplit also provides a method fetchOne to fetch just the first entity of a query result.