Condividi tramite


Conflicts.GetConflictQueryStreamIterator Method

Definition

Overloads

GetConflictQueryStreamIterator(QueryDefinition, String, QueryRequestOptions)

Gets an iterator to go through all the conflicts for the container as the original ResponseMessage

GetConflictQueryStreamIterator(String, String, QueryRequestOptions)

Gets an iterator to go through all the conflicts for the container as the original ResponseMessage

GetConflictQueryStreamIterator(QueryDefinition, String, QueryRequestOptions)

Source:
Conflicts.cs

Gets an iterator to go through all the conflicts for the container as the original ResponseMessage

public abstract Microsoft.Azure.Cosmos.FeedIterator GetConflictQueryStreamIterator (Microsoft.Azure.Cosmos.QueryDefinition queryDefinition, string continuationToken = default, Microsoft.Azure.Cosmos.QueryRequestOptions requestOptions = default);
abstract member GetConflictQueryStreamIterator : Microsoft.Azure.Cosmos.QueryDefinition * string * Microsoft.Azure.Cosmos.QueryRequestOptions -> Microsoft.Azure.Cosmos.FeedIterator
Public MustOverride Function GetConflictQueryStreamIterator (queryDefinition As QueryDefinition, Optional continuationToken As String = Nothing, Optional requestOptions As QueryRequestOptions = Nothing) As FeedIterator

Parameters

queryDefinition
QueryDefinition

The cosmos SQL query definition.

continuationToken
String

(Optional) The continuation token in the Azure Cosmos DB service.

requestOptions
QueryRequestOptions

(Optional) The options for the item query request.

Returns

An iterator to go through the conflicts.

Examples

Example on how to fully drain the query results.

QueryDefinition queryDefinition = new QueryDefinition("select * From c where c._rid = @rid")
              .WithParameter("@rid", "TheRidValue");
using (FeedIterator feedIterator = this.CosmosClient.GetConflictQueryStreamIterator(
    queryDefinition))
{
    while (feedIterator.HasMoreResults)
    {
        // Stream iterator returns a response with status for errors
        using(ResponseMessage response = await feedIterator.ReadNextAsync())
        {
            // Handle failure scenario. 
            if(!response.IsSuccessStatusCode)
            {
                // Log the response.Diagnostics and handle the error
            }
        }
    }
}

Applies to

GetConflictQueryStreamIterator(String, String, QueryRequestOptions)

Source:
Conflicts.cs

Gets an iterator to go through all the conflicts for the container as the original ResponseMessage

public abstract Microsoft.Azure.Cosmos.FeedIterator GetConflictQueryStreamIterator (string queryText = default, string continuationToken = default, Microsoft.Azure.Cosmos.QueryRequestOptions requestOptions = default);
abstract member GetConflictQueryStreamIterator : string * string * Microsoft.Azure.Cosmos.QueryRequestOptions -> Microsoft.Azure.Cosmos.FeedIterator
Public MustOverride Function GetConflictQueryStreamIterator (Optional queryText As String = Nothing, Optional continuationToken As String = Nothing, Optional requestOptions As QueryRequestOptions = Nothing) As FeedIterator

Parameters

queryText
String

The cosmos SQL query text.

continuationToken
String

(Optional) The continuation token in the Azure Cosmos DB service.

requestOptions
QueryRequestOptions

(Optional) The options for the item query request.

Returns

An iterator to go through the conflicts.

Examples

Example on how to fully drain the query results.

using (FeedIterator feedIterator = this.CosmosClient.GetConflictQueryStreamIterator(
    "select * From c where c._rid = \"TheRidValue\""))
{
    while (feedIterator.HasMoreResults)
    {
        // Stream iterator returns a response with status for errors
        using(ResponseMessage response = await feedIterator.ReadNextAsync())
        {
            // Handle failure scenario. 
            if(!response.IsSuccessStatusCode)
            {
                // Log the response.Diagnostics and handle the error
            }
        }
    }
}

Applies to