Token.firstWhere()
Get the first matching accessible Token.
Signature
Token.firstWhere(predicate: () => Boolean)) => <Document> | NullToken
Token.firstWhere(predicate: (val: Token) => Boolean)) => <Document> | NullToken
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
predicate |
An anonymous function that compares values in each |
Examples
Token.firstWhere(.document.id == "401670797851099213")
{
id: "401670938431586381",
coll: Token,
ts: Time("2099-06-25T13:28:27.660Z"),
document: Customer("401670797851099213")
}
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!