Skip to main content
The db global reads and writes records in the product’s database. Both methods are asynchronous (they return Promises).

Query

string
required
The table to read from.
object
Field filters — plain values for equality, or an operator object (see below).
object
{ limit?, offset?, orderBy?, ascending? }. Without orderBy, results come back newest-first (created_at descending).

Filter operators

A filter value can be an operator object instead of a plain value — for range and comparison queries:
Multiple operators on one field combine (AND), and multiple fields combine (AND).

Insert

Example — render the latest reading

Next: location

Read device geolocation.