Reading data
In this document, you’ll learn how to read data from your database with Typesaurus.
There are several methods that allow reading documents:
get
- gets a single document by idall
- gets all documents in a collectionquery
- queries documents by fieldsmany
- gets documents by their ids
get
To get a single document from a collection:
get
is also available on Ref
and Doc
:
all
To get all documents from a collection:
query
To query documents from a collection:
many
To get documents by their ids:
Realtime
You can subscribe to updates by calling .on
on any of the reading methods:
The on
function returns off
, the function that you can call to unsubscribe: