Database
Database( name, [database] )
Database( name, [database] )
Database( name, [database] )
Database( name, [database] )
database( name, [database] )
Database( name, [database] )
Description
The Database
function returns a valid
Reference for the specified child database
name
, within the specified child database
. If a child database
is
not specified, the returned database reference belongs to the current
database.
The Database
function only looks up 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).
Returns
A reference to a child database with the specified name
, in the
specified child database
(or the current database is database
is not
specified).
Examples
The following query gets a reference to the database named "prydain" within the current database:
client.Query(
Database("prydain")
);
RefV(id = "prydain", collection = RefV(id = "databases"))
result, err := client.Query(
f.Database("prydain"))
if err != nil {
fmt.Fprintln(os.Stderr, err)
} else {
fmt.Println(result)
}
{prydain 0xc000162090 0xc000162090 <nil>}
System.out.println(
client.query(
Database(Value("prydain"))
).get());
ref(id = "prydain", collection = ref(id = "databases"))
client.query(
q.Database('prydain')
)
.then((ret) => console.log(ret))
.catch((err) => console.error('Error: %s', err))
Database("prydain")
result = client.query(
q.database("prydain")
)
print(result)
Ref(id=prydain, collection=Ref(id=databases))
client.query(Database("prydain"))
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!