4.6.0 (latest) 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.1 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.5.0 2.4.0 2.3.0

    [BindServiceMethod(typeof(Firestore), "BindService")]
    public abstract class Firestore.FirestoreBase

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

Base class for server-side implementations of Firestore

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> Firestore.FirestoreBase

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Firestore.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1)

## Assembly

Google.Cloud.Firestore.V1.dll

## Methods

### BatchGetDocuments(BatchGetDocumentsRequest, IServerStreamWriter\<BatchGetDocumentsResponse\>, ServerCallContext)

    public virtual Task BatchGetDocuments(BatchGetDocumentsRequest request, IServerStreamWriter<BatchGetDocumentsResponse> responseStream, ServerCallContext context)

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.BatchGetDocumentsRequest` The request received from the client. |
| `responseStream` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IServerStreamWriter-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.BatchGetDocumentsResponse` Used for sending responses back to the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task indicating completion of the handler. |

### BatchWrite(BatchWriteRequest, ServerCallContext)

    public virtual Task<BatchWriteResponse> BatchWrite(BatchWriteRequest request, ServerCallContext context)

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.BatchWriteRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.BatchWriteResponse` | The response to send back to the client (wrapped by a task). |

### BeginTransaction(BeginTransactionRequest, ServerCallContext)

    public virtual Task<BeginTransactionResponse> BeginTransaction(BeginTransactionRequest request, ServerCallContext context)

Starts a new transaction.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.BeginTransactionRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.BeginTransactionResponse` | The response to send back to the client (wrapped by a task). |

### Commit(CommitRequest, ServerCallContext)

    public virtual Task<CommitResponse> Commit(CommitRequest request, ServerCallContext context)

Commits a transaction, while optionally updating documents.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.CommitRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.CommitResponse` | The response to send back to the client (wrapped by a task). |

### CreateDocument(CreateDocumentRequest, ServerCallContext)

    public virtual Task<Document> CreateDocument(CreateDocumentRequest request, ServerCallContext context)

Creates a new document.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.CreateDocumentRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.Document` | The response to send back to the client (wrapped by a task). |

### DeleteDocument(DeleteDocumentRequest, ServerCallContext)

    public virtual Task<Empty> DeleteDocument(DeleteDocumentRequest request, ServerCallContext context)

Deletes a document.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.DeleteDocumentRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Empty.html` | The response to send back to the client (wrapped by a task). |

### ExecutePipeline(ExecutePipelineRequest, IServerStreamWriter\<ExecutePipelineResponse\>, ServerCallContext)

    public virtual Task ExecutePipeline(ExecutePipelineRequest request, IServerStreamWriter<ExecutePipelineResponse> responseStream, ServerCallContext context)

Executes a pipeline query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.ExecutePipelineRequest` The request received from the client. |
| `responseStream` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IServerStreamWriter-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.ExecutePipelineResponse` Used for sending responses back to the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task indicating completion of the handler. |

### GetDocument(GetDocumentRequest, ServerCallContext)

    public virtual Task<Document> GetDocument(GetDocumentRequest request, ServerCallContext context)

Gets a single document.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.GetDocumentRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.Document` | The response to send back to the client (wrapped by a task). |

### ListCollectionIds(ListCollectionIdsRequest, ServerCallContext)

    public virtual Task<ListCollectionIdsResponse> ListCollectionIds(ListCollectionIdsRequest request, ServerCallContext context)

Lists all the collection IDs underneath a document.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.ListCollectionIdsRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.ListCollectionIdsResponse` | The response to send back to the client (wrapped by a task). |

### ListDocuments(ListDocumentsRequest, ServerCallContext)

    public virtual Task<ListDocumentsResponse> ListDocuments(ListDocumentsRequest request, ServerCallContext context)

Lists documents.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.ListDocumentsRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.ListDocumentsResponse` | The response to send back to the client (wrapped by a task). |

### Listen(IAsyncStreamReader\<ListenRequest\>, IServerStreamWriter\<ListenResponse\>, ServerCallContext)

    public virtual Task Listen(IAsyncStreamReader<ListenRequest> requestStream, IServerStreamWriter<ListenResponse> responseStream, ServerCallContext context)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `requestStream` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IAsyncStreamReader-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.ListenRequest` Used for reading requests from the client. |
| `responseStream` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IServerStreamWriter-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.ListenResponse` Used for sending responses back to the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task indicating completion of the handler. |

### PartitionQuery(PartitionQueryRequest, ServerCallContext)

    public virtual Task<PartitionQueryResponse> PartitionQuery(PartitionQueryRequest request, ServerCallContext context)

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.PartitionQueryRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.PartitionQueryResponse` | The response to send back to the client (wrapped by a task). |

### Rollback(RollbackRequest, ServerCallContext)

    public virtual Task<Empty> Rollback(RollbackRequest request, ServerCallContext context)

Rolls back a transaction.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.RollbackRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Empty.html` | The response to send back to the client (wrapped by a task). |

### RunAggregationQuery(RunAggregationQueryRequest, IServerStreamWriter\<RunAggregationQueryResponse\>, ServerCallContext)

    public virtual Task RunAggregationQuery(RunAggregationQueryRequest request, IServerStreamWriter<RunAggregationQueryResponse> responseStream, ServerCallContext context)

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.RunAggregationQueryRequest` The request received from the client. |
| `responseStream` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IServerStreamWriter-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.RunAggregationQueryResponse` Used for sending responses back to the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task indicating completion of the handler. |

### RunQuery(RunQueryRequest, IServerStreamWriter\<RunQueryResponse\>, ServerCallContext)

    public virtual Task RunQuery(RunQueryRequest request, IServerStreamWriter<RunQueryResponse> responseStream, ServerCallContext context)

Runs a query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.RunQueryRequest` The request received from the client. |
| `responseStream` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IServerStreamWriter-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.RunQueryResponse` Used for sending responses back to the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task indicating completion of the handler. |

### UpdateDocument(UpdateDocumentRequest, ServerCallContext)

    public virtual Task<Document> UpdateDocument(UpdateDocumentRequest request, ServerCallContext context)

Updates or inserts a document.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.UpdateDocumentRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.Document` | The response to send back to the client (wrapped by a task). |

### Write(IAsyncStreamReader\<WriteRequest\>, IServerStreamWriter\<WriteResponse\>, ServerCallContext)

    public virtual Task Write(IAsyncStreamReader<WriteRequest> requestStream, IServerStreamWriter<WriteResponse> responseStream, ServerCallContext context)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `requestStream` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IAsyncStreamReader-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.WriteRequest` Used for reading requests from the client. |
| `responseStream` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IServerStreamWriter-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.WriteResponse` Used for sending responses back to the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task indicating completion of the handler. |