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. |
Key.where()
Get the Set of accessible keys in the database.
Signature
Key.where(predicate: () => Boolean)) => Set<Key>
Key.where(predicate: (val: Key) => Boolean)) => Set<Key>
Description
Each Key in a Fauna database is represented by a Key
object. Key.where()
gets the Set of accessible Key
objects that match the predicate function.
If Key.where()
is the last value in a query, the first page
of the Set is returned.
Parameters
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"
}
}
]
}
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!