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.create()

Signature

Database.create(data: { name: String, priority: Number | Null, typechecked: Boolean | Null, protected: Boolean | Null, data: { *: Any } | Null }) => DatabaseDef

Description

Creates a child database with the provided metadata and settings. The parent database is the database to which the query’s the authentication secret is scoped.

Using Database.create() to create a top-level database is not supported.

Fauna stores child databases as documents in the parent database’s Database system collection. Database documents have the DatabaseDef type.

Parameters

Parameter Type Required Description

data

Object

true

Document fields containing metadata and settings for the new Database document.

For supported document fields, see Database collection.

Return value

Type Description

DatabaseDef

The new Database document.

Examples

Database.create({
  name: "childDB",
  typechecked: true,
  priority: 10
})
{
  name: "childDB",
  coll: Database,
  ts: Time("2099-06-24T21:53:40.670Z"),
  typechecked: true,
  priority: 10,
  global_id: "ysjpygonryyr1"
}

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!