REST Resource: projects.databases

Stay organized with collections Save and categorize content based on your preferences.

Resource: Database

A Cloud Firestore Database. Currently only one database is allowed per cloud project; this database must have a databaseId of '(default)'.

JSON representation
{
  "name": string,
  "uid": string,
  "createTime": string,
  "updateTime": string,
  "locationId": string,
  "type": enum (DatabaseType),
  "concurrencyMode": enum (ConcurrencyMode),
  "appEngineIntegrationMode": enum (AppEngineIntegrationMode),
  "keyPrefix": string,
  "etag": string
}
Fields
name

string

The resource name of the Database. Format: projects/{project}/databases/{database}

uid

string

Output only. The system-generated UUID4 for this Database.

createTime

string (Timestamp format)

Output only. The timestamp at which this database was created.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. The timestamp at which this database was most recently updated. Note this only includes updates to the database resource and not data contained by the database.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

locationId

string

The location of the database. Available databases are listed at https://cloud.google.com/firestore/docs/locations.

type

enum (DatabaseType)

The type of the database. See https://cloud.google.com/datastore/docs/firestore-or-datastore for information about how to choose.

concurrencyMode

enum (ConcurrencyMode)

The concurrency control mode to use for this database.

appEngineIntegrationMode

enum (AppEngineIntegrationMode)

The App Engine integration mode to use for this database.

keyPrefix

string

Output only. The keyPrefix for this database. This keyPrefix is used, in combination with the project id ("~") to construct the application id that is returned from the Cloud Datastore APIs in Google App Engine first generation runtimes.

This value may be empty in which case the appid to use for URL-encoded keys is the projectId (eg: foo instead of v~foo).

etag

string

This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.

DatabaseType

The type of the database. See https://cloud.google.com/datastore/docs/firestore-or-datastore for information about how to choose.

Mode changes are only allowed if the database is empty.

Enums
DATABASE_TYPE_UNSPECIFIED The default value. This value is used if the database type is omitted.
FIRESTORE_NATIVE Firestore Native Mode
DATASTORE_MODE Firestore in Datastore Mode.

ConcurrencyMode

The type of concurrency control mode for transactions.

Enums
CONCURRENCY_MODE_UNSPECIFIED Not used.
OPTIMISTIC Use optimistic concurrency control by default. This mode is available for Cloud Firestore databases.
PESSIMISTIC

Use pessimistic concurrency control by default. This mode is available for Cloud Firestore databases.

This is the default setting for Cloud Firestore.

OPTIMISTIC_WITH_ENTITY_GROUPS

Use optimistic concurrency control with entity groups by default.

This is the only available mode for Cloud Datastore.

This mode is also available for Cloud Firestore with Datastore Mode but is not recommended.

AppEngineIntegrationMode

The type of App Engine integration mode.

Enums
APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED Not used.
ENABLED If an App Engine application exists in the same region as this database, App Engine configuration will impact this database. This includes disabling of the application & database, as well as disabling writes to the database.
DISABLED Appengine has no affect on the ability of this database to serve requests.

Methods

create

Create a database.

exportDocuments

Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage.

get

Gets information about a database.

importDocuments

Imports documents into Google Cloud Firestore.

list

List all the databases in the project.

patch

Updates a database.