Database

Learn: Databases

Fauna supports a hierarchical database structure, allowing for top-level and child databases.

Fauna stores metadata and settings for databases as documents in the Database system collection.

Scope

The Database collection only contains documents for the direct child databases of the database scoped to your authentication secret. You can’t use the Database collection to access parent, peer, or other descendant databases.

If you use an authentication secret scoped to an account’s top-level context, the Database collection contains documents for the account’s top-level databases. You can create a top-level secret using the fauna cloud-login command.

Static methods

Method Description

Gets a set of all Database collection documents.

Gets a Database collection document by its name.

Creates a database.

Gets the first Database collection document that matches a provided predicate.

Gets the name of the Database system collection name as a string.

Gets a set of Database collection documents that match a provided predicate.

Instance methods

Method Description

Deletes a database.

Verifies that a database exists.

Replaces a database’s metadata and settings.

Updates a database’s metadata and settings.

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!