Cloud Firestore V1 Client - Class Database (1.52.0)

Reference documentation and code samples for the Cloud Firestore V1 Client class Database.

A Cloud Firestore Database.

Generated from protobuf message google.firestore.admin.v1.Database

Namespace

Google \ Cloud \ Firestore \ Admin \ V1

Methods

__construct

Constructor.

Parameters
Name
Description
data
array

Optional. Data for populating the Message object.

↳ name
string

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

↳ uid
string

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

↳ create_time
Google\Protobuf\Timestamp

Output only. The timestamp at which this database was created. Databases created before 2016 do not populate create_time.

↳ update_time
Google\Protobuf\Timestamp

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.

↳ delete_time
Google\Protobuf\Timestamp

Output only. The timestamp at which this database was deleted. Only set if the database has been deleted.

↳ location_id
string

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

↳ type
int

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

↳ concurrency_mode
int

The concurrency control mode to use for this database.

↳ version_retention_period
Google\Protobuf\Duration

Output only. The period during which past versions of data are retained in the database. Any read or query can specify a read_time within this window, and will read the state of the database at that time. If the PITR feature is enabled, the retention period is 7 days. Otherwise, the retention period is 1 hour.

↳ earliest_version_time
Google\Protobuf\Timestamp

Output only. The earliest timestamp at which older versions of the data can be read from the database. See [version_retention_period] above; this field is populated with now - version_retention_period . This value is continuously updated, and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.

↳ point_in_time_recovery_enablement
int

Whether to enable the PITR feature on this database.

↳ app_engine_integration_mode
int

The App Engine integration mode to use for this database.

↳ key_prefix
string

Output only. The key_prefix for this database. This key_prefix is used, in combination with the project ID ("

↳ delete_protection_state
int

State of delete protection for the database.

↳ cmek_config
Database\CmekConfig

Optional. Presence indicates CMEK is enabled for this database.

↳ previous_id
string

Output only. The database resource's prior database ID. This field is only populated for deleted databases.

↳ source_info
Database\SourceInfo

Output only. Information about the provenance of this database.

↳ tags
array| Google\Protobuf\Internal\MapField

Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing"

↳ free_tier
bool

Output only. Background: Free tier is the ability of a Firestore database to use a small amount of resources every day without being charged. Once usage exceeds the free tier limit further usage is charged. Whether this database can make use of the free tier. Only one database per project can be eligible for the free tier. The first (or next) database that is created in a project without a free tier database will be marked as eligible for the free tier. Databases that are created while there is a free tier database will not be eligible for the free tier.

↳ 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.

↳ database_edition
int

Immutable. The edition of the database.

getName

The resource name of the Database.

Format: projects/{project}/databases/{database}

Returns
Type
Description
string

setName

The resource name of the Database.

Format: projects/{project}/databases/{database}

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getUid

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

Returns
Type
Description
string

setUid

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

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getCreateTime

Output only. The timestamp at which this database was created. Databases created before 2016 do not populate create_time.

Returns
Type
Description

hasCreateTime

clearCreateTime

setCreateTime

Output only. The timestamp at which this database was created. Databases created before 2016 do not populate create_time.

Parameter
Name
Description
Returns
Type
Description
$this

getUpdateTime

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.

Returns
Type
Description

hasUpdateTime

clearUpdateTime

setUpdateTime

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.

Parameter
Name
Description
Returns
Type
Description
$this

getDeleteTime

Output only. The timestamp at which this database was deleted. Only set if the database has been deleted.

Returns
Type
Description

hasDeleteTime

clearDeleteTime

setDeleteTime

Output only. The timestamp at which this database was deleted. Only set if the database has been deleted.

Parameter
Name
Description
Returns
Type
Description
$this

getLocationId

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

Returns
Type
Description
string

setLocationId

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

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getType

The type of the database.

See https://cloud.google.com/datastore/docs/firestore-or-datastore for information about how to choose.

Returns
Type
Description
int

setType

The type of the database.

See https://cloud.google.com/datastore/docs/firestore-or-datastore for information about how to choose.

Parameter
Name
Description
var
int
Returns
Type
Description
$this

getConcurrencyMode

The concurrency control mode to use for this database.

Returns
Type
Description
int

setConcurrencyMode

The concurrency control mode to use for this database.

Parameter
Name
Description
var
int
Returns
Type
Description
$this

getVersionRetentionPeriod

Output only. The period during which past versions of data are retained in the database.

Any read or query can specify a read_time within this window, and will read the state of the database at that time. If the PITR feature is enabled, the retention period is 7 days. Otherwise, the retention period is 1 hour.

Returns
Type
Description

hasVersionRetentionPeriod

clearVersionRetentionPeriod

setVersionRetentionPeriod

Output only. The period during which past versions of data are retained in the database.

Any read or query can specify a read_time within this window, and will read the state of the database at that time. If the PITR feature is enabled, the retention period is 7 days. Otherwise, the retention period is 1 hour.

Parameter
Name
Description
Returns
Type
Description
$this

getEarliestVersionTime

Output only. The earliest timestamp at which older versions of the data can be read from the database. See [version_retention_period] above; this field is populated with now - version_retention_period .

This value is continuously updated, and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.

Returns
Type
Description

hasEarliestVersionTime

clearEarliestVersionTime

setEarliestVersionTime

Output only. The earliest timestamp at which older versions of the data can be read from the database. See [version_retention_period] above; this field is populated with now - version_retention_period .

This value is continuously updated, and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.

Parameter
Name
Description
Returns
Type
Description
$this

getPointInTimeRecoveryEnablement

Whether to enable the PITR feature on this database.

Returns
Type
Description
int

setPointInTimeRecoveryEnablement

Whether to enable the PITR feature on this database.

Parameter
Name
Description
var
int
Returns
Type
Description
$this

getAppEngineIntegrationMode

The App Engine integration mode to use for this database.

Returns
Type
Description
int

setAppEngineIntegrationMode

The App Engine integration mode to use for this database.

Parameter
Name
Description
var
int
Returns
Type
Description
$this

getKeyPrefix

Output only. The key_prefix for this database. This key_prefix is used, in combination with the project ID ("

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

Returns
Type
Description
string

setKeyPrefix

Output only. The key_prefix for this database. This key_prefix is used, in combination with the project ID ("

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

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getDeleteProtectionState

State of delete protection for the database.

Returns
Type
Description
int

setDeleteProtectionState

State of delete protection for the database.

Parameter
Name
Description
var
int
Returns
Type
Description
$this

getCmekConfig

Optional. Presence indicates CMEK is enabled for this database.

Returns
Type
Description

hasCmekConfig

clearCmekConfig

setCmekConfig

Optional. Presence indicates CMEK is enabled for this database.

Parameter
Name
Description
Returns
Type
Description
$this

getPreviousId

Output only. The database resource's prior database ID. This field is only populated for deleted databases.

Returns
Type
Description
string

setPreviousId

Output only. The database resource's prior database ID. This field is only populated for deleted databases.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getSourceInfo

Output only. Information about the provenance of this database.

Returns
Type
Description

hasSourceInfo

clearSourceInfo

setSourceInfo

Output only. Information about the provenance of this database.

Parameter
Name
Description
Returns
Type
Description
$this

getTags

Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing"

Returns
Type
Description

setTags

Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing"

Parameter
Name
Description
Returns
Type
Description
$this

getFreeTier

Output only. Background: Free tier is the ability of a Firestore database to use a small amount of resources every day without being charged. Once usage exceeds the free tier limit further usage is charged.

Whether this database can make use of the free tier. Only one database per project can be eligible for the free tier. The first (or next) database that is created in a project without a free tier database will be marked as eligible for the free tier. Databases that are created while there is a free tier database will not be eligible for the free tier.

Returns
Type
Description
bool

hasFreeTier

clearFreeTier

setFreeTier

Output only. Background: Free tier is the ability of a Firestore database to use a small amount of resources every day without being charged. Once usage exceeds the free tier limit further usage is charged.

Whether this database can make use of the free tier. Only one database per project can be eligible for the free tier. The first (or next) database that is created in a project without a free tier database will be marked as eligible for the free tier. Databases that are created while there is a free tier database will not be eligible for the free tier.

Parameter
Name
Description
var
bool
Returns
Type
Description
$this

getEtag

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.

Returns
Type
Description
string

setEtag

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.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getDatabaseEdition

Immutable. The edition of the database.

Returns
Type
Description
int

setDatabaseEdition

Immutable. The edition of the database.

Parameter
Name
Description
var
int
Returns
Type
Description
$this
Create a Mobile Website
View Site in Mobile | Classic
Share by: