Database.byName()

Get a database document by its name.

Signature

Database.byName(name: string): DatabaseDef | NullDatabaseDef

Description

Each child database in a Fauna database is represented by a Database object, and each Database object has a name. This method gets the child database object by its name if it exists.

Parameters

Parameter Type Required Description

name

String

Yes

Name of the child database to get.

Return value

One of:

Type Description

DatabaseDef

Child database document.

NullDatabaseDef

Database doesn’t exist or is inaccessible.

Examples

Database.byName("childDB")
{
  name: "childDB",
  coll: Database,
  ts: Time("2099-06-24T21:54:38.890Z"),
  global_id: "ysjpykbahyyr1",
  priority: 10,
  typechecked: true
}

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!