AccessProvider.where()
Get the Set of accessible AccessProviders in the database.
Signature
AccessProvider.where( predicate: () => Boolean)): Set<AccessProvider>
AccessProvider.where( predicate: (val: AccessProvider) => Boolean)): Set<AccessProvider>
Description
Each provider in a Fauna database is represented by a AccessProvider
document. AccessProvider.where()
gets the set of accessible providers that
match the predicate function. The predicate function must return a
Boolean
.
If AccessProvider.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 provider and returns
|
Return value
One of:
Type | Description |
---|---|
Set representing the access providers that match the predicate function. |
|
Returns |
Examples
{
data: [
{
name: "theAccessProvider",
coll: AccessProvider,
ts: Time("2023-07-28T03:52:58.610Z"),
roles: "humanResources",
audience: "https://db.fauna.com/db/ywtfhw4poyynr",
jwks_uri: "https://fauna.auth0.com/.well-known/jwks.json",
issuer: "https://fauna-updated.auth0.com"
},
{
name: "newAccesProvider",
coll: AccessProvider,
ts: Time("2023-07-28T03:49:22.120Z"),
audience: "https://db.fauna.com/db/ywtfhw4poyynr",
roles: [
"mgmtTeam",
{
role: "mgmtTeam",
predicate: "_ => true"
}
],
jwks_uri: "https://fauna.auth0.com/.well-known/jwks.json",
issuer: "https://fauna.auth2.com",
data: {
custom: "some data"
}
}
]
}
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!