all
To get all documents in a collection, use the all
method on Collection
.
The method returns an array of Doc
instances:
Subscription
Instead of awaiting the promise returned from all
, you can call on
on it to subscribe to the document updates:
To catch errors, use catch
after calling on
:
To stop listening to the updates, call the off
function returned from the method:
→ Read more about subscribing to real-time updates
Options
as
You can tell Typesaurus that it’s safe to use dates by passing the as
option ("server" | "client"
):
By default, Typesaurus uses the "client"
option.