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. |
Database.where()
Learn: Databases and multi-tenancy |
---|
Get a Set of child databases that match a provided predicate.
Description
Gets a Set of child databases,
represented as Database
documents,
that match a provided predicate
function.
Fauna stores child databases as documents in the parent database’s
Database
system collection.
Database
documents have the DatabaseDef type.
If Database.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
Database.where(.name.includes("child"))
{
data: [
{
name: "childDB",
coll: Database,
ts: Time("2099-06-24T21:54:38.890Z"),
global_id: "ysjpykbahyyr1",
priority: 10,
typechecked: true
},
...
]
}
Database.where(childDB => childDB.priority == 10)
{
data: [
{
name: "childDB",
coll: Database,
ts: Time("2099-06-24T21:54:38.890Z"),
typechecked: true,
global_id: "ysjpykbahyyr1",
priority: 10
},
...
]
}
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!