5.3.0 (latest) 5.2.0 5.1.0 5.0.0 4.17.0 4.16.0 4.15.0 4.14.0 4.13.0 4.12.0 4.11.0 4.10.0 4.9.0 4.8.0 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.5.0 3.4.0 3.3.0 3.2.0

    public sealed class DatastoreQuery

Reference documentation and code samples for the Google Cloud Datastore v1 API class DatastoreQuery.

A Datastore query with additional options for features such as read consistency and profiling.

## Inheritance

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

## 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.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

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

## Assembly

Google.Cloud.Datastore.V1.dll

## Properties

### AggregationQuery

    public AggregationQuery AggregationQuery { get; set; }

The aggregation query to execute. For regular queries, this must be null.
For aggregation queries, exactly one of this property or [GqlQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreQuery#Google_Cloud_Datastore_V1_DatastoreQuery_GqlQuery)
must be set when the query is executed.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery` |   |

### ExplainOptions

    public ExplainOptions ExplainOptions { get; set; }

The profiling (explain) options to use for query execution, if any.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ExplainOptions` |   |

### GqlQuery

    public GqlQuery GqlQuery { get; set; }

The GQL query to execute. For regular queries, exactly one of this property or [Query](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreQuery#Google_Cloud_Datastore_V1_DatastoreQuery_Query)
must be set when the query is executed. For aggregation queries,
exactly one of this property or [AggregationQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreQuery#Google_Cloud_Datastore_V1_DatastoreQuery_AggregationQuery) must be set when the query is executed.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.GqlQuery` |   |

### Query

    public Query Query { get; set; }

The structured query to execute. For regular queries, exactly one of this property or [GqlQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.DatastoreQuery#Google_Cloud_Datastore_V1_DatastoreQuery_GqlQuery)
must be set when the query is executed. For aggregation queries, this must be null.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Query` |   |

### ReadConsistency

    public ReadOptions.Types.ReadConsistency? ReadConsistency { get; set; }

The level of read consistency to apply, if any. This property is ignored when the query is executed in a transaction.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptionshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.ReadOptions.Types.ReadConsistency` |   |