Key.where()
Description
Gets a Set of keys, represented as
Key
documents, that match a provided
predicate function.
A key is a type of authentication secret used for anonymous access to a Fauna database. Unlike tokens, keys are not associated with an identity.
If Key.where()
is the last expression in a query, the first page of the Set
is returned. See Pagination.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
pred |
Yes |
Anonymous predicate function that:
The method returns a Set of |
Examples
Key.where(.data != null)
{
data: [
{
id: "412655134325080576",
coll: Key,
ts: Time("2099-07-19T20:53:15.250Z"),
role: "admin",
data: {
desc: "Admin key for prod app database"
}
},
{
id: "412655134325080577",
coll: Key,
ts: Time("2099-07-28T02:25:35.050Z"),
role: "server",
data: {
desc: "Server key for prod app database"
}
}
]
}