Firestore v1 API - Class Firestore.FirestoreClient (3.9.0)

public class Firestore.FirestoreClient : ClientBase<Firestore.FirestoreClient>

Reference documentation and code samples for the Firestore v1 API class Firestore.FirestoreClient.

Client for Firestore

Inheritance

object > ClientBase > ClientBaseFirestoreFirestoreClient > Firestore.FirestoreClient

Namespace

Google.Cloud.Firestore.V1

Assembly

Google.Cloud.Firestore.V1.dll

Constructors

FirestoreClient()

protected FirestoreClient()

Protected parameterless constructor to allow creation of test doubles.

FirestoreClient(CallInvoker)

public FirestoreClient(CallInvoker callInvoker)

Creates a new client for Firestore that uses a custom CallInvoker.

Parameter
Name Description
callInvoker CallInvoker

The callInvoker to use to make remote calls.

FirestoreClient(ChannelBase)

public FirestoreClient(ChannelBase channel)

Creates a new client for Firestore

Parameter
Name Description
channel ChannelBase

The channel to use to make remote calls.

FirestoreClient(ClientBaseConfiguration)

protected FirestoreClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration

The client configuration.

Methods

BatchGetDocuments(BatchGetDocumentsRequest, CallOptions)

public virtual AsyncServerStreamingCall<BatchGetDocumentsResponse> BatchGetDocuments(BatchGetDocumentsRequest request, CallOptions options)

Gets multiple documents.

Documents returned by this method are not guaranteed to be returned in the same order that they were requested.

Parameters
Name Description
request BatchGetDocumentsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncServerStreamingCallBatchGetDocumentsResponse

The call object.

BatchGetDocuments(BatchGetDocumentsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncServerStreamingCall<BatchGetDocumentsResponse> BatchGetDocuments(BatchGetDocumentsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets multiple documents.

Documents returned by this method are not guaranteed to be returned in the same order that they were requested.

Parameters
Name Description
request BatchGetDocumentsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncServerStreamingCallBatchGetDocumentsResponse

The call object.

BatchWrite(BatchWriteRequest, CallOptions)

public virtual BatchWriteResponse BatchWrite(BatchWriteRequest request, CallOptions options)

Applies a batch of write operations.

The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per document. Each write succeeds or fails independently. See the [BatchWriteResponse][google.firestore.v1.BatchWriteResponse] for the success status of each write.

If you require an atomically applied set of writes, use [Commit][google.firestore.v1.Firestore.Commit] instead.

Parameters
Name Description
request BatchWriteRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
BatchWriteResponse

The response received from the server.

BatchWrite(BatchWriteRequest, Metadata, DateTime?, CancellationToken)

public virtual BatchWriteResponse BatchWrite(BatchWriteRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Applies a batch of write operations.

The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per document. Each write succeeds or fails independently. See the [BatchWriteResponse][google.firestore.v1.BatchWriteResponse] for the success status of each write.

If you require an atomically applied set of writes, use [Commit][google.firestore.v1.Firestore.Commit] instead.

Parameters
Name Description
request BatchWriteRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
BatchWriteResponse

The response received from the server.

BatchWriteAsync(BatchWriteRequest, CallOptions)

public virtual AsyncUnaryCall<BatchWriteResponse> BatchWriteAsync(BatchWriteRequest request, CallOptions options)

Applies a batch of write operations.

The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per document. Each write succeeds or fails independently. See the [BatchWriteResponse][google.firestore.v1.BatchWriteResponse] for the success status of each write.

If you require an atomically applied set of writes, use [Commit][google.firestore.v1.Firestore.Commit] instead.

Parameters
Name Description
request BatchWriteRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallBatchWriteResponse

The call object.

BatchWriteAsync(BatchWriteRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<BatchWriteResponse> BatchWriteAsync(BatchWriteRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Applies a batch of write operations.

The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per document. Each write succeeds or fails independently. See the [BatchWriteResponse][google.firestore.v1.BatchWriteResponse] for the success status of each write.

If you require an atomically applied set of writes, use [Commit][google.firestore.v1.Firestore.Commit] instead.

Parameters
Name Description
request BatchWriteRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallBatchWriteResponse

The call object.

BeginTransaction(BeginTransactionRequest, CallOptions)

public virtual BeginTransactionResponse BeginTransaction(BeginTransactionRequest request, CallOptions options)

Starts a new transaction.

Parameters
Name Description
request BeginTransactionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
BeginTransactionResponse

The response received from the server.

BeginTransaction(BeginTransactionRequest, Metadata, DateTime?, CancellationToken)

public virtual BeginTransactionResponse BeginTransaction(BeginTransactionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Starts a new transaction.

Parameters
Name Description
request BeginTransactionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
BeginTransactionResponse

The response received from the server.

BeginTransactionAsync(BeginTransactionRequest, CallOptions)

public virtual AsyncUnaryCall<BeginTransactionResponse> BeginTransactionAsync(BeginTransactionRequest request, CallOptions options)

Starts a new transaction.

Parameters
Name Description
request BeginTransactionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallBeginTransactionResponse

The call object.

BeginTransactionAsync(BeginTransactionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<BeginTransactionResponse> BeginTransactionAsync(BeginTransactionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Starts a new transaction.

Parameters
Name Description
request BeginTransactionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallBeginTransactionResponse

The call object.

Commit(CommitRequest, CallOptions)

public virtual CommitResponse Commit(CommitRequest request, CallOptions options)

Commits a transaction, while optionally updating documents.

Parameters
Name Description
request CommitRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
CommitResponse

The response received from the server.

Commit(CommitRequest, Metadata, DateTime?, CancellationToken)

public virtual CommitResponse Commit(CommitRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Commits a transaction, while optionally updating documents.

Parameters
Name Description
request CommitRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
CommitResponse

The response received from the server.

CommitAsync(CommitRequest, CallOptions)

public virtual AsyncUnaryCall<CommitResponse> CommitAsync(CommitRequest request, CallOptions options)

Commits a transaction, while optionally updating documents.

Parameters
Name Description
request CommitRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallCommitResponse

The call object.

CommitAsync(CommitRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<CommitResponse> CommitAsync(CommitRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Commits a transaction, while optionally updating documents.

Parameters
Name Description
request CommitRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallCommitResponse

The call object.

CreateDocument(CreateDocumentRequest, CallOptions)

public virtual Document CreateDocument(CreateDocumentRequest request, CallOptions options)

Creates a new document.

Parameters
Name Description
request CreateDocumentRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Document

The response received from the server.

CreateDocument(CreateDocumentRequest, Metadata, DateTime?, CancellationToken)

public virtual Document CreateDocument(CreateDocumentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Creates a new document.

Parameters
Name Description
request CreateDocumentRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Document

The response received from the server.

CreateDocumentAsync(CreateDocumentRequest, CallOptions)

public virtual AsyncUnaryCall<Document> CreateDocumentAsync(CreateDocumentRequest request, CallOptions options)

Creates a new document.

Parameters
Name Description
request CreateDocumentRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallDocument

The call object.

CreateDocumentAsync(CreateDocumentRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Document> CreateDocumentAsync(CreateDocumentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Creates a new document.

Parameters
Name Description
request CreateDocumentRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallDocument

The call object.

CreateLocationsClient()

public virtual Locations.LocationsClient CreateLocationsClient()

Creates a new instance of Locations.LocationsClient using the same call invoker as this client.

Returns
Type Description
LocationsLocationsClient

A new Locations.LocationsClient for the same target as this client.

DeleteDocument(DeleteDocumentRequest, CallOptions)

public virtual Empty DeleteDocument(DeleteDocumentRequest request, CallOptions options)

Deletes a document.

Parameters
Name Description
request DeleteDocumentRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Empty

The response received from the server.

DeleteDocument(DeleteDocumentRequest, Metadata, DateTime?, CancellationToken)

public virtual Empty DeleteDocument(DeleteDocumentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes a document.

Parameters
Name Description
request DeleteDocumentRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Empty

The response received from the server.

DeleteDocumentAsync(DeleteDocumentRequest, CallOptions)

public virtual AsyncUnaryCall<Empty> DeleteDocumentAsync(DeleteDocumentRequest request, CallOptions options)

Deletes a document.

Parameters
Name Description
request DeleteDocumentRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

DeleteDocumentAsync(DeleteDocumentRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Empty> DeleteDocumentAsync(DeleteDocumentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes a document.

Parameters
Name Description
request DeleteDocumentRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

GetDocument(GetDocumentRequest, CallOptions)

public virtual Document GetDocument(GetDocumentRequest request, CallOptions options)

Gets a single document.

Parameters
Name Description
request GetDocumentRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Document

The response received from the server.

GetDocument(GetDocumentRequest, Metadata, DateTime?, CancellationToken)

public virtual Document GetDocument(GetDocumentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets a single document.

Parameters
Name Description
request GetDocumentRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Document

The response received from the server.

GetDocumentAsync(GetDocumentRequest, CallOptions)

public virtual AsyncUnaryCall<Document> GetDocumentAsync(GetDocumentRequest request, CallOptions options)

Gets a single document.

Parameters
Name Description
request GetDocumentRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallDocument

The call object.

GetDocumentAsync(GetDocumentRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Document> GetDocumentAsync(GetDocumentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets a single document.

Parameters
Name Description
request GetDocumentRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallDocument

The call object.

ListCollectionIds(ListCollectionIdsRequest, CallOptions)

public virtual ListCollectionIdsResponse ListCollectionIds(ListCollectionIdsRequest request, CallOptions options)

Lists all the collection IDs underneath a document.

Parameters
Name Description
request ListCollectionIdsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListCollectionIdsResponse

The response received from the server.

ListCollectionIds(ListCollectionIdsRequest, Metadata, DateTime?, CancellationToken)

public virtual ListCollectionIdsResponse ListCollectionIds(ListCollectionIdsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists all the collection IDs underneath a document.

Parameters
Name Description
request ListCollectionIdsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListCollectionIdsResponse

The response received from the server.

ListCollectionIdsAsync(ListCollectionIdsRequest, CallOptions)

public virtual AsyncUnaryCall<ListCollectionIdsResponse> ListCollectionIdsAsync(ListCollectionIdsRequest request, CallOptions options)

Lists all the collection IDs underneath a document.

Parameters
Name Description
request ListCollectionIdsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListCollectionIdsResponse

The call object.

ListCollectionIdsAsync(ListCollectionIdsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListCollectionIdsResponse> ListCollectionIdsAsync(ListCollectionIdsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists all the collection IDs underneath a document.

Parameters
Name Description
request ListCollectionIdsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListCollectionIdsResponse

The call object.

ListDocuments(ListDocumentsRequest, CallOptions)

public virtual ListDocumentsResponse ListDocuments(ListDocumentsRequest request, CallOptions options)

Lists documents.

Parameters
Name Description
request ListDocumentsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListDocumentsResponse

The response received from the server.

ListDocuments(ListDocumentsRequest, Metadata, DateTime?, CancellationToken)

public virtual ListDocumentsResponse ListDocuments(ListDocumentsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists documents.

Parameters
Name Description
request ListDocumentsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListDocumentsResponse

The response received from the server.

ListDocumentsAsync(ListDocumentsRequest, CallOptions)

public virtual AsyncUnaryCall<ListDocumentsResponse> ListDocumentsAsync(ListDocumentsRequest request, CallOptions options)

Lists documents.

Parameters
Name Description
request ListDocumentsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListDocumentsResponse

The call object.

ListDocumentsAsync(ListDocumentsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListDocumentsResponse> ListDocumentsAsync(ListDocumentsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists documents.

Parameters
Name Description
request ListDocumentsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListDocumentsResponse

The call object.

Listen(CallOptions)

public virtual AsyncDuplexStreamingCall<ListenRequest, ListenResponse> Listen(CallOptions options)

Listens to changes. This method is only available via gRPC or WebChannel (not REST).

Parameter
Name Description
options CallOptions

The options for the call.

Returns
Type Description
AsyncDuplexStreamingCallListenRequestListenResponse

The call object.

Listen(Metadata, DateTime?, CancellationToken)

public virtual AsyncDuplexStreamingCall<ListenRequest, ListenResponse> Listen(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Listens to changes. This method is only available via gRPC or WebChannel (not REST).

Parameters
Name Description
headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncDuplexStreamingCallListenRequestListenResponse

The call object.

NewInstance(ClientBaseConfiguration)

protected override Firestore.FirestoreClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration
Returns
Type Description
FirestoreFirestoreClient
Overrides
Grpc.Core.ClientBase<Google.Cloud.Firestore.V1.Firestore.FirestoreClient>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

PartitionQuery(PartitionQueryRequest, CallOptions)

public virtual PartitionQueryResponse PartitionQuery(PartitionQueryRequest request, CallOptions options)

Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as starting/end points for the query results.

Parameters
Name Description
request PartitionQueryRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
PartitionQueryResponse

The response received from the server.

PartitionQuery(PartitionQueryRequest, Metadata, DateTime?, CancellationToken)

public virtual PartitionQueryResponse PartitionQuery(PartitionQueryRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as starting/end points for the query results.

Parameters
Name Description
request PartitionQueryRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
PartitionQueryResponse

The response received from the server.

PartitionQueryAsync(PartitionQueryRequest, CallOptions)

public virtual AsyncUnaryCall<PartitionQueryResponse> PartitionQueryAsync(PartitionQueryRequest request, CallOptions options)

Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as starting/end points for the query results.

Parameters
Name Description
request PartitionQueryRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallPartitionQueryResponse

The call object.

PartitionQueryAsync(PartitionQueryRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<PartitionQueryResponse> PartitionQueryAsync(PartitionQueryRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as starting/end points for the query results.

Parameters
Name Description
request PartitionQueryRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallPartitionQueryResponse

The call object.

Rollback(RollbackRequest, CallOptions)

public virtual Empty Rollback(RollbackRequest request, CallOptions options)

Rolls back a transaction.

Parameters
Name Description
request RollbackRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Empty

The response received from the server.

Rollback(RollbackRequest, Metadata, DateTime?, CancellationToken)

public virtual Empty Rollback(RollbackRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Rolls back a transaction.

Parameters
Name Description
request RollbackRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Empty

The response received from the server.

RollbackAsync(RollbackRequest, CallOptions)

public virtual AsyncUnaryCall<Empty> RollbackAsync(RollbackRequest request, CallOptions options)

Rolls back a transaction.

Parameters
Name Description
request RollbackRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

RollbackAsync(RollbackRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Empty> RollbackAsync(RollbackRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Rolls back a transaction.

Parameters
Name Description
request RollbackRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

RunAggregationQuery(RunAggregationQueryRequest, CallOptions)

public virtual AsyncServerStreamingCall<RunAggregationQueryResponse> RunAggregationQuery(RunAggregationQueryRequest request, CallOptions options)

Runs an aggregation query.

Rather than producing [Document][google.firestore.v1.Document] results like [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery], this API allows running an aggregation to produce a series of [AggregationResult][google.firestore.v1.AggregationResult] server-side.

High-Level Example:

-- Return the number of documents in table given a filter.
SELECT COUNT(*) FROM ( SELECT * FROM k where a = true );
Parameters
Name Description
request RunAggregationQueryRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncServerStreamingCallRunAggregationQueryResponse

The call object.

RunAggregationQuery(RunAggregationQueryRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncServerStreamingCall<RunAggregationQueryResponse> RunAggregationQuery(RunAggregationQueryRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Runs an aggregation query.

Rather than producing [Document][google.firestore.v1.Document] results like [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery], this API allows running an aggregation to produce a series of [AggregationResult][google.firestore.v1.AggregationResult] server-side.

High-Level Example:

-- Return the number of documents in table given a filter.
SELECT COUNT(*) FROM ( SELECT * FROM k where a = true );
Parameters
Name Description
request RunAggregationQueryRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncServerStreamingCallRunAggregationQueryResponse

The call object.

RunQuery(RunQueryRequest, CallOptions)

public virtual AsyncServerStreamingCall<RunQueryResponse> RunQuery(RunQueryRequest request, CallOptions options)

Runs a query.

Parameters
Name Description
request RunQueryRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncServerStreamingCallRunQueryResponse

The call object.

RunQuery(RunQueryRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncServerStreamingCall<RunQueryResponse> RunQuery(RunQueryRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Runs a query.

Parameters
Name Description
request RunQueryRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncServerStreamingCallRunQueryResponse

The call object.

UpdateDocument(UpdateDocumentRequest, CallOptions)

public virtual Document UpdateDocument(UpdateDocumentRequest request, CallOptions options)

Updates or inserts a document.

Parameters
Name Description
request UpdateDocumentRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Document

The response received from the server.

UpdateDocument(UpdateDocumentRequest, Metadata, DateTime?, CancellationToken)

public virtual Document UpdateDocument(UpdateDocumentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Updates or inserts a document.

Parameters
Name Description
request UpdateDocumentRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Document

The response received from the server.

UpdateDocumentAsync(UpdateDocumentRequest, CallOptions)

public virtual AsyncUnaryCall<Document> UpdateDocumentAsync(UpdateDocumentRequest request, CallOptions options)

Updates or inserts a document.

Parameters
Name Description
request UpdateDocumentRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallDocument

The call object.

UpdateDocumentAsync(UpdateDocumentRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Document> UpdateDocumentAsync(UpdateDocumentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Updates or inserts a document.

Parameters
Name Description
request UpdateDocumentRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallDocument

The call object.

Write(CallOptions)

public virtual AsyncDuplexStreamingCall<WriteRequest, WriteResponse> Write(CallOptions options)

Streams batches of document updates and deletes, in order. This method is only available via gRPC or WebChannel (not REST).

Parameter
Name Description
options CallOptions

The options for the call.

Returns
Type Description
AsyncDuplexStreamingCallWriteRequestWriteResponse

The call object.

Write(Metadata, DateTime?, CancellationToken)

public virtual AsyncDuplexStreamingCall<WriteRequest, WriteResponse> Write(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Streams batches of document updates and deletes, in order. This method is only available via gRPC or WebChannel (not REST).

Parameters
Name Description
headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncDuplexStreamingCallWriteRequestWriteResponse

The call object.