Token.where()
Get the Set of accessible Tokens in the database.
Signature
Token.where(predicate: () => Boolean)): Set<Token>
Token.where(predicate: (val: Token) => Boolean)): Set<Token>
Description
Each Token in a Fauna database is represented by a Token
object. Token.where()
gets the Set of accessible Token
objects 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 |
An anonymous function that compares values in each |
Return value
Type | Description |
---|---|
type:Set<type:Token> |
Set representing the documents that match the predicate function. If this
method is the last value in a query, the method returns the first page of the
|
Examples
{
data: [
{
id: "373081653342371873",
coll: Token,
ts: Time("2023-08-14T23:54:00.750Z"),
document: People.byId("372696914650464289")
},
{
id: "373081673116418081",
coll: Token,
ts: Time("2023-08-14T23:54:19.610Z"),
document: People.byId("372696914650464289")
}
]
}
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!