Firestore

google.firestore.v1. Firestore

Represents a Firestore

Constructor

new Firestore(rpcImpl, requestDelimitedopt, responseDelimitedopt)

Constructs a new Firestore service.

Parameters:
Name Type Attributes Default Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean <optional>
false

Whether requests are length-delimited

responseDelimited boolean <optional>
false

Whether responses are length-delimited

Extends

  • $protobuf.rpc.Service

Methods

batchGetDocuments(request, callback) → {undefined}

Calls BatchGetDocuments.

Parameters:
Name Type Description
request google.firestore.v1.IBatchGetDocumentsRequest

BatchGetDocumentsRequest message or plain object

callback google.firestore.v1.Firestore.BatchGetDocumentsCallback

Node-style callback called with the error, if any, and BatchGetDocumentsResponse

Returns:
Type Description
undefined

batchGetDocuments(request) → {Promise.<google.firestore.v1.BatchGetDocumentsResponse>}

Calls BatchGetDocuments.

Parameters:
Name Type Description
request google.firestore.v1.IBatchGetDocumentsRequest

BatchGetDocumentsRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.BatchGetDocumentsResponse>

Promise

batchWrite(request, callback) → {undefined}

Calls BatchWrite.

Parameters:
Name Type Description
request google.firestore.v1.IBatchWriteRequest

BatchWriteRequest message or plain object

callback google.firestore.v1.Firestore.BatchWriteCallback

Node-style callback called with the error, if any, and BatchWriteResponse

Returns:
Type Description
undefined

batchWrite(request) → {Promise.<google.firestore.v1.BatchWriteResponse>}

Calls BatchWrite.

Parameters:
Name Type Description
request google.firestore.v1.IBatchWriteRequest

BatchWriteRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.BatchWriteResponse>

Promise

beginTransaction(request, callback) → {undefined}

Calls BeginTransaction.

Parameters:
Name Type Description
request google.firestore.v1.IBeginTransactionRequest

BeginTransactionRequest message or plain object

callback google.firestore.v1.Firestore.BeginTransactionCallback

Node-style callback called with the error, if any, and BeginTransactionResponse

Returns:
Type Description
undefined

beginTransaction(request) → {Promise.<google.firestore.v1.BeginTransactionResponse>}

Calls BeginTransaction.

Parameters:
Name Type Description
request google.firestore.v1.IBeginTransactionRequest

BeginTransactionRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.BeginTransactionResponse>

Promise

commit(request, callback) → {undefined}

Calls Commit.

Parameters:
Name Type Description
request google.firestore.v1.ICommitRequest

CommitRequest message or plain object

callback google.firestore.v1.Firestore.CommitCallback

Node-style callback called with the error, if any, and CommitResponse

Returns:
Type Description
undefined

commit(request) → {Promise.<google.firestore.v1.CommitResponse>}

Calls Commit.

Parameters:
Name Type Description
request google.firestore.v1.ICommitRequest

CommitRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.CommitResponse>

Promise

createDocument(request, callback) → {undefined}

Calls CreateDocument.

Parameters:
Name Type Description
request google.firestore.v1.ICreateDocumentRequest

CreateDocumentRequest message or plain object

callback google.firestore.v1.Firestore.CreateDocumentCallback

Node-style callback called with the error, if any, and Document

Returns:
Type Description
undefined

createDocument(request) → {Promise.<google.firestore.v1.Document>}

Calls CreateDocument.

Parameters:
Name Type Description
request google.firestore.v1.ICreateDocumentRequest

CreateDocumentRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.Document>

Promise

deleteDocument(request, callback) → {undefined}

Calls DeleteDocument.

Parameters:
Name Type Description
request google.firestore.v1.IDeleteDocumentRequest

DeleteDocumentRequest message or plain object

callback google.firestore.v1.Firestore.DeleteDocumentCallback

Node-style callback called with the error, if any, and Empty

Returns:
Type Description
undefined

deleteDocument(request) → {Promise.<google.protobuf.Empty>}

Calls DeleteDocument.

Parameters:
Name Type Description
request google.firestore.v1.IDeleteDocumentRequest

DeleteDocumentRequest message or plain object

Returns:
Type Description
Promise.<google.protobuf.Empty>

Promise

getDocument(request, callback) → {undefined}

Calls GetDocument.

Parameters:
Name Type Description
request google.firestore.v1.IGetDocumentRequest

GetDocumentRequest message or plain object

callback google.firestore.v1.Firestore.GetDocumentCallback

Node-style callback called with the error, if any, and Document

Returns:
Type Description
undefined

getDocument(request) → {Promise.<google.firestore.v1.Document>}

Calls GetDocument.

Parameters:
Name Type Description
request google.firestore.v1.IGetDocumentRequest

GetDocumentRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.Document>

Promise

listCollectionIds(request, callback) → {undefined}

Calls ListCollectionIds.

Parameters:
Name Type Description
request google.firestore.v1.IListCollectionIdsRequest

ListCollectionIdsRequest message or plain object

callback google.firestore.v1.Firestore.ListCollectionIdsCallback

Node-style callback called with the error, if any, and ListCollectionIdsResponse

Returns:
Type Description
undefined

listCollectionIds(request) → {Promise.<google.firestore.v1.ListCollectionIdsResponse>}

Calls ListCollectionIds.

Parameters:
Name Type Description
request google.firestore.v1.IListCollectionIdsRequest

ListCollectionIdsRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.ListCollectionIdsResponse>

Promise

listDocuments(request, callback) → {undefined}

Calls ListDocuments.

Parameters:
Name Type Description
request google.firestore.v1.IListDocumentsRequest

ListDocumentsRequest message or plain object

callback google.firestore.v1.Firestore.ListDocumentsCallback

Node-style callback called with the error, if any, and ListDocumentsResponse

Returns:
Type Description
undefined

listDocuments(request) → {Promise.<google.firestore.v1.ListDocumentsResponse>}

Calls ListDocuments.

Parameters:
Name Type Description
request google.firestore.v1.IListDocumentsRequest

ListDocumentsRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.ListDocumentsResponse>

Promise

listen(request, callback) → {undefined}

Calls Listen.

Parameters:
Name Type Description
request google.firestore.v1.IListenRequest

ListenRequest message or plain object

callback google.firestore.v1.Firestore.ListenCallback

Node-style callback called with the error, if any, and ListenResponse

Returns:
Type Description
undefined

listen(request) → {Promise.<google.firestore.v1.ListenResponse>}

Calls Listen.

Parameters:
Name Type Description
request google.firestore.v1.IListenRequest

ListenRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.ListenResponse>

Promise

partitionQuery(request, callback) → {undefined}

Calls PartitionQuery.

Parameters:
Name Type Description
request google.firestore.v1.IPartitionQueryRequest

PartitionQueryRequest message or plain object

callback google.firestore.v1.Firestore.PartitionQueryCallback

Node-style callback called with the error, if any, and PartitionQueryResponse

Returns:
Type Description
undefined

partitionQuery(request) → {Promise.<google.firestore.v1.PartitionQueryResponse>}

Calls PartitionQuery.

Parameters:
Name Type Description
request google.firestore.v1.IPartitionQueryRequest

PartitionQueryRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.PartitionQueryResponse>

Promise

rollback(request, callback) → {undefined}

Calls Rollback.

Parameters:
Name Type Description
request google.firestore.v1.IRollbackRequest

RollbackRequest message or plain object

callback google.firestore.v1.Firestore.RollbackCallback

Node-style callback called with the error, if any, and Empty

Returns:
Type Description
undefined

rollback(request) → {Promise.<google.protobuf.Empty>}

Calls Rollback.

Parameters:
Name Type Description
request google.firestore.v1.IRollbackRequest

RollbackRequest message or plain object

Returns:
Type Description
Promise.<google.protobuf.Empty>

Promise

runAggregationQuery(request, callback) → {undefined}

Calls RunAggregationQuery.

Parameters:
Name Type Description
request google.firestore.v1.IRunAggregationQueryRequest

RunAggregationQueryRequest message or plain object

callback google.firestore.v1.Firestore.RunAggregationQueryCallback

Node-style callback called with the error, if any, and RunAggregationQueryResponse

Returns:
Type Description
undefined

runAggregationQuery(request) → {Promise.<google.firestore.v1.RunAggregationQueryResponse>}

Calls RunAggregationQuery.

Parameters:
Name Type Description
request google.firestore.v1.IRunAggregationQueryRequest

RunAggregationQueryRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.RunAggregationQueryResponse>

Promise

runQuery(request, callback) → {undefined}

Calls RunQuery.

Parameters:
Name Type Description
request google.firestore.v1.IRunQueryRequest

RunQueryRequest message or plain object

callback google.firestore.v1.Firestore.RunQueryCallback

Node-style callback called with the error, if any, and RunQueryResponse

Returns:
Type Description
undefined

runQuery(request) → {Promise.<google.firestore.v1.RunQueryResponse>}

Calls RunQuery.

Parameters:
Name Type Description
request google.firestore.v1.IRunQueryRequest

RunQueryRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.RunQueryResponse>

Promise

updateDocument(request, callback) → {undefined}

Calls UpdateDocument.

Parameters:
Name Type Description
request google.firestore.v1.IUpdateDocumentRequest

UpdateDocumentRequest message or plain object

callback google.firestore.v1.Firestore.UpdateDocumentCallback

Node-style callback called with the error, if any, and Document

Returns:
Type Description
undefined

updateDocument(request) → {Promise.<google.firestore.v1.Document>}

Calls UpdateDocument.

Parameters:
Name Type Description
request google.firestore.v1.IUpdateDocumentRequest

UpdateDocumentRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.Document>

Promise

write(request, callback) → {undefined}

Calls Write.

Parameters:
Name Type Description
request google.firestore.v1.IWriteRequest

WriteRequest message or plain object

callback google.firestore.v1.Firestore.WriteCallback

Node-style callback called with the error, if any, and WriteResponse

Returns:
Type Description
undefined

write(request) → {Promise.<google.firestore.v1.WriteResponse>}

Calls Write.

Parameters:
Name Type Description
request google.firestore.v1.IWriteRequest

WriteRequest message or plain object

Returns:
Type Description
Promise.<google.firestore.v1.WriteResponse>

Promise

Type Definitions

BatchGetDocumentsCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#batchGetDocuments.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.BatchGetDocumentsResponse <optional>

BatchGetDocumentsResponse

BatchWriteCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#batchWrite.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.BatchWriteResponse <optional>

BatchWriteResponse

BeginTransactionCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#beginTransaction.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.BeginTransactionResponse <optional>

BeginTransactionResponse

CommitCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#commit.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.CommitResponse <optional>

CommitResponse

CreateDocumentCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#createDocument.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.Document <optional>

Document

DeleteDocumentCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#deleteDocument.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.protobuf.Empty <optional>

Empty

GetDocumentCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#getDocument.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.Document <optional>

Document

ListCollectionIdsCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#listCollectionIds.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.ListCollectionIdsResponse <optional>

ListCollectionIdsResponse

ListDocumentsCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#listDocuments.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.ListDocumentsResponse <optional>

ListDocumentsResponse

ListenCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#listen.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.ListenResponse <optional>

ListenResponse

PartitionQueryCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#partitionQuery.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.PartitionQueryResponse <optional>

PartitionQueryResponse

RollbackCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#rollback.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.protobuf.Empty <optional>

Empty

RunAggregationQueryCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#runAggregationQuery.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.RunAggregationQueryResponse <optional>

RunAggregationQueryResponse

RunQueryCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#runQuery.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.RunQueryResponse <optional>

RunQueryResponse

UpdateDocumentCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#updateDocument.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.Document <optional>

Document

WriteCallback(error, responseopt)

Callback as used by google.firestore.v1.Firestore#write.

Parameters:
Name Type Attributes Description
error Error | null

Error, if any

response google.firestore.v1.WriteResponse <optional>

WriteResponse