共用方式為


Scripts.GetUserDefinedFunctionQueryIterator Method

Definition

Overloads

GetUserDefinedFunctionQueryIterator<T>(QueryDefinition, String, QueryRequestOptions)

This method creates a query for user defined functions under a container using a SQL statement with parameterized values. It returns a FeedIterator. For more information on preparing SQL statements with parameterized values, please see QueryDefinition overload.

GetUserDefinedFunctionQueryIterator<T>(String, String, QueryRequestOptions)

This method creates a query for user defined functions under a container using a SQL statement. It returns a FeedIterator.

GetUserDefinedFunctionQueryIterator<T>(QueryDefinition, String, QueryRequestOptions)

Source:
Scripts.cs

This method creates a query for user defined functions under a container using a SQL statement with parameterized values. It returns a FeedIterator. For more information on preparing SQL statements with parameterized values, please see QueryDefinition overload.

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

Type Parameters

T

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 read through the existing stored procedures.

Examples

This create the type feed iterator for UDF with queryDefinition as input.

Scripts scripts = this.container.Scripts;
QueryDefinition queryDefinition = new QueryDefinition("SELECT * FROM u where u.id like @testId")
    .WithParameter("@testId", "testUDFId");
using (FeedIterator<UserDefinedFunctionProperties> feedIterator = this.scripts.GetUserDefinedFunctionQueryIterator<UserDefinedFunctionProperties>(queryDefinition)
{
    while (feedIterator.HasMoreResults)
    {
        foreach (var properties in await feedIterator.ReadNextAsync())
        {
            Console.WriteLine(properties.Id);
        }
    }
}

Applies to

GetUserDefinedFunctionQueryIterator<T>(String, String, QueryRequestOptions)

Source:
Scripts.cs

This method creates a query for user defined functions under a container using a SQL statement. It returns a FeedIterator.

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

Type Parameters

T

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 read through the existing stored procedures.

Examples

This create the type feed iterator for UDF with queryText as input.

Scripts scripts = this.container.Scripts;
using (FeedIterator<UserDefinedFunctionProperties> feedIterator = this.scripts.GetUserDefinedFunctionQueryIterator<UserDefinedFunctionProperties>(
    "SELECT * FROM u where u.id like '%testId%'")
{
    while (feedIterator.HasMoreResults)
    {
        foreach (var properties in await feedIterator.ReadNextAsync())
        {
            Console.WriteLine(properties.Id);
        }
    }
}

Applies to