many
To get documents from a collection by their ids, use the many
method on Collection
.
The method returns an array of Doc
or null
if particular document doesn’t exist:
Subscription
Instead of awaiting the promise returned from many
, you can call on
on it to subscribe to documents updates:
To stop listening to the updates, call the off
function returned from the method:
To catch errors, use catch
after calling on
:
→ 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.