where()
Get the Set of matching accessible documents in the collection.
Signature
where(predicate: () => Boolean)): Set<Collection>
where(predicate: (val: Document) => Boolean)): Set<Collection>
Description
Returns the Set of accessible document in the collection that match the predicate function.
The predicate function must return a Boolean.
If where()
is the last value in a query, the first page
of the Set is returned.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
predicate |
Yes |
Anonymous function that compares values in each collection document
and returns |
Return value
Type | Description |
---|---|
Set<Document> |
Set of matching accessible documents. |
Examples
{
data: [
{
id: "357101835888099361",
coll: Letter,
ts: Time("2023-02-19T14:41:39.230Z"),
name: "A"
},
{
id: "357101842659803169",
coll: Letter,
ts: Time("2023-02-19T14:41:45.693Z"),
name: "B"
}
]
}
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!