Databases

Databases( [database] )
Databases( [database] )
Databases( [database] )
Databases( [database] )
databases( [database] )
databases [database]
Databases( [database] )
Databases( [database] )

Description

The Databases function when executed with Paginate returns an array of Refs for sub-databases in the database specified. If no database is provided, it returns an array of references to sub-databases in the current database.

Parameters

Argument Type Definition and Requirements

database

Ref

Optional - The target database.

Returns

A schema set reference.

Examples

The query below retrieves the references to sub-databases within the current database.

curl https://db.fauna.com/ \
    -u fnAChGwBacACAEZtRZFDXpyjIvq-sln34m-va4Km: \
    -d '{ "paginate": { "databases": null } }'
client.Query(Paginate(Databases()));
System.out.println(client.query(Paginate(Databases())).get());
result, _ := client.Query(f.Paginate(f.Databases()))

fmt.Println(result)
client.query(Paginate(Databases()))
client.query(q.paginate(q.databases()))
$client.query do
  paginate databases
end
client.query(Paginate(Databases()))
client.query(q.Paginate(q.Databases()))
.then((ret) => console.log(ret))
HTTP/1.1 200 OK
{ "resource": [{ "@ref": "databases/prydain" }] }
[{ "@ref": "databases/prydain" }]
[ref(id = "prydain", collection = ref(id = "databases"))]
[{prydain 0xc420316a60 <nil>}]
[{ "@ref": "databases/prydain" }]
[{ "@ref": "databases/prydain" }]
[{ "@ref": "databases/prydain" }]
[{ "@ref": "databases/prydain" }]
[Ref(id=prydain, collection=Ref(id=databases))]

Was this article helpful?

We're sorry to hear that.
Tell us how we can improve! documentation@fauna.com

Thank you for your feedback!