Check out v4 of the Fauna CLI
v4 of the Fauna CLI is now in beta. The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start. |
Credential.firstWhere()
Get the first credential matching a provided predicate.
Description
Gets the first Credential
document that matches a provided
predicate function.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
pred |
Yes |
Anonymous predicate function that:
The method returns the first |
Return value
One of:
Type | Description |
---|---|
First |
|
No |
Examples
Credential.firstWhere(.document == Customer.byId("111"))
{
id: "371153420791316514",
coll: Credential,
ts: Time("2099-07-24T17:05:34.890Z"),
document: Customer("111")
}
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!