Constructor
new FirestoreAdminClient(optionsopt)
Construct an instance of FirestoreAdminClient.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. See the subsequent parameters for more details. Properties
|
- Source:
Members
(static) apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
- Source:
(static) port
The port for this API service.
- Source:
(static) scopes
The scopes needed to make gRPC calls for every method defined in this service.
- Source:
(static) servicePath
The DNS address for this API service.
- Source:
Methods
close()
Terminate the GRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
- Source:
collectionGroupPath(project, database, collection) → {string}
Return a fully-qualified collectiongroup resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
database |
string | |
collection |
string |
- Source:
createIndex(request, optionsopt) → {Promise}
Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the creation. The metadata for the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
databasePath(project, database) → {string}
Return a fully-qualified database resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
database |
string |
- Source:
deleteIndex(request, optionsopt) → {Promise}
Deletes a composite index.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
exportDocuments(request, optionsopt) → {Promise}
Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
fieldPath(project, database, collection, field) → {string}
Return a fully-qualified field resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
database |
string | |
collection |
string | |
field |
string |
- Source:
getField(request, optionsopt) → {Promise}
Gets the metadata and configuration for a Field.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
getIndex(request, optionsopt) → {Promise}
Gets a composite index.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
getProjectId(callback)
Return the project ID used by this class.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
the callback to be called with the current project Id. |
- Source:
importDocuments(request, optionsopt) → {Promise}
Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
indexPath(project, database, collection, index) → {string}
Return a fully-qualified index resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
database |
string | |
collection |
string | |
index |
string |
- Source:
listFields(request, optionsopt) → {Promise}
Lists the field configuration and metadata for this database.
Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
that have been explicitly overridden. To issue this query, call
[FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
indexConfig.usesAncestorConfig:false
.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
listFieldsStream(request, optionsopt) → {Stream}
Equivalent to listFields, but returns a NodeJS Stream object.
This fetches the paged responses for listFields continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
listIndexes(request, optionsopt) → {Promise}
Lists composite indexes.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source:
listIndexesStream(request, optionsopt) → {Stream}
Equivalent to listIndexes, but returns a NodeJS Stream object.
This fetches the paged responses for listIndexes continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
matchCollectionFromCollectionGroupName(collectiongroupName) → {string}
Parse the collection from CollectionGroup resource.
Parameters:
Name | Type | Description |
---|---|---|
collectiongroupName |
string |
A fully-qualified path representing CollectionGroup resource. |
- Source:
matchCollectionFromFieldName(fieldName) → {string}
Parse the collection from Field resource.
Parameters:
Name | Type | Description |
---|---|---|
fieldName |
string |
A fully-qualified path representing Field resource. |
- Source:
matchCollectionFromIndexName(indexName) → {string}
Parse the collection from Index resource.
Parameters:
Name | Type | Description |
---|---|---|
indexName |
string |
A fully-qualified path representing Index resource. |
- Source:
matchDatabaseFromCollectionGroupName(collectiongroupName) → {string}
Parse the database from CollectionGroup resource.
Parameters:
Name | Type | Description |
---|---|---|
collectiongroupName |
string |
A fully-qualified path representing CollectionGroup resource. |
- Source:
matchDatabaseFromDatabaseName(databaseName) → {string}
Parse the database from Database resource.
Parameters:
Name | Type | Description |
---|---|---|
databaseName |
string |
A fully-qualified path representing Database resource. |
- Source:
matchDatabaseFromFieldName(fieldName) → {string}
Parse the database from Field resource.
Parameters:
Name | Type | Description |
---|---|---|
fieldName |
string |
A fully-qualified path representing Field resource. |
- Source:
matchDatabaseFromIndexName(indexName) → {string}
Parse the database from Index resource.
Parameters:
Name | Type | Description |
---|---|---|
indexName |
string |
A fully-qualified path representing Index resource. |
- Source:
matchFieldFromFieldName(fieldName) → {string}
Parse the field from Field resource.
Parameters:
Name | Type | Description |
---|---|---|
fieldName |
string |
A fully-qualified path representing Field resource. |
- Source:
matchIndexFromIndexName(indexName) → {string}
Parse the index from Index resource.
Parameters:
Name | Type | Description |
---|---|---|
indexName |
string |
A fully-qualified path representing Index resource. |
- Source:
matchProjectFromCollectionGroupName(collectiongroupName) → {string}
Parse the project from CollectionGroup resource.
Parameters:
Name | Type | Description |
---|---|---|
collectiongroupName |
string |
A fully-qualified path representing CollectionGroup resource. |
- Source:
matchProjectFromDatabaseName(databaseName) → {string}
Parse the project from Database resource.
Parameters:
Name | Type | Description |
---|---|---|
databaseName |
string |
A fully-qualified path representing Database resource. |
- Source:
matchProjectFromFieldName(fieldName) → {string}
Parse the project from Field resource.
Parameters:
Name | Type | Description |
---|---|---|
fieldName |
string |
A fully-qualified path representing Field resource. |
- Source:
matchProjectFromIndexName(indexName) → {string}
Parse the project from Index resource.
Parameters:
Name | Type | Description |
---|---|---|
indexName |
string |
A fully-qualified path representing Index resource. |
- Source:
updateField(request, optionsopt) → {Promise}
Updates a field configuration. Currently, field updates apply only to
single field index configuration. However, calls to
[FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid
changing any configuration that the caller isn't aware of. The field mask
should be specified as: { paths: "index_config" }
.
This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the field update. The metadata for the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].
To configure the default field settings for the database, use
the special Field
with resource name:
projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*
.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
- Source: