Databases
Databases( [database] )
Description
The Databases
function, when executed with
Paginate, returns an array of
References for child databases in the
specified child database
. If a child database
is not specified,
the returned child database references all belong to the current
database.
The Databases
function only reports child databases, so finding a
database using this function requires you to use an admin key for the
current database (a server or client key cannot be used to access any
child database).
Parameters
Argument | Type | Definition and Requirements |
---|---|---|
|
Optional - A reference to a child database. If not specified, the current database is used. |
Returns
A Set reference for the available databases in the
specified child database
(or the current database if database
is not
specified).
Examples
The query below retrieves the references to sub-databases within the current database:
client.query(q.Paginate(q.Databases()))
.then((ret) => console.log(ret))
[Ref(id=prydain, collection=Ref(id=databases))]
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!