IDocumentClient.CreateUserDefinedFunctionQuery Method

Definition

Overloads

CreateUserDefinedFunctionQuery(String, FeedOptions)

Overloaded. This method creates a query for udfs under a collection in an Azure Cosmos DB service. It returns An IOrderedQueryable{UserDefinedFunction}.

CreateUserDefinedFunctionQuery(Uri, FeedOptions)

Method to create a query for user-defined functions in the Azure Cosmos DB service.

CreateUserDefinedFunctionQuery(String, SqlQuerySpec, FeedOptions)

Overloaded. This method creates a query for udfs under a collection in the Azure Cosmos DB service with parameterized values. It returns an IQueryable{dynamic}. For more information on preparing SQL statements with parameterized values, please see SqlQuerySpec.

CreateUserDefinedFunctionQuery(String, String, FeedOptions)

Overloaded. This method creates a query for udfs under a collection in an Azure Cosmos DB database using a SQL statement. It returns an IQueryable{dynamic}.

CreateUserDefinedFunctionQuery(Uri, SqlQuerySpec, FeedOptions)

Method to create a query for user-defined functions in the Azure Cosmos DB service.

CreateUserDefinedFunctionQuery(Uri, String, FeedOptions)

Method to create a query for user-defined functions in the Azure Cosmos DB service.

CreateUserDefinedFunctionQuery(String, FeedOptions)

Overloaded. This method creates a query for udfs under a collection in an Azure Cosmos DB service. It returns An IOrderedQueryable{UserDefinedFunction}.

public System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.UserDefinedFunction> CreateUserDefinedFunctionQuery (string collectionLink, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateUserDefinedFunctionQuery : string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.UserDefinedFunction>
Public Function CreateUserDefinedFunctionQuery (collectionLink As String, Optional feedOptions As FeedOptions = Nothing) As IOrderedQueryable(Of UserDefinedFunction)

Parameters

collectionLink
String

The link to the parent collection resource.

feedOptions
FeedOptions

The options for processing the query result feed. For details, see FeedOptions

Returns

An IOrderedQueryable{UserDefinedFunction} that can evaluate the query with the provided SQL statement.

Examples

This example below queries for user-defined functions by id.

UserDefinedFunction udf = client.CreateUserDefinedFunctionQuery(collectionLink).Where(u => u.Id == "sqrt").AsEnumerable().FirstOrDefault();

See also

Applies to

CreateUserDefinedFunctionQuery(Uri, FeedOptions)

Method to create a query for user-defined functions in the Azure Cosmos DB service.

public System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.UserDefinedFunction> CreateUserDefinedFunctionQuery (Uri documentCollectionUri, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateUserDefinedFunctionQuery : Uri * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.UserDefinedFunction>
Public Function CreateUserDefinedFunctionQuery (documentCollectionUri As Uri, Optional feedOptions As FeedOptions = Nothing) As IOrderedQueryable(Of UserDefinedFunction)

Parameters

documentCollectionUri
Uri

The URI of the parent document collection.

feedOptions
FeedOptions

(Optional) The FeedOptions for processing the query results feed.

Returns

The query result set.

Applies to

CreateUserDefinedFunctionQuery(String, SqlQuerySpec, FeedOptions)

Overloaded. This method creates a query for udfs under a collection in the Azure Cosmos DB service with parameterized values. It returns an IQueryable{dynamic}. For more information on preparing SQL statements with parameterized values, please see SqlQuerySpec.

public System.Linq.IQueryable<dynamic> CreateUserDefinedFunctionQuery (string collectionLink, Microsoft.Azure.Documents.SqlQuerySpec querySpec, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateUserDefinedFunctionQuery : string * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
Public Function CreateUserDefinedFunctionQuery (collectionLink As String, querySpec As SqlQuerySpec, Optional feedOptions As FeedOptions = Nothing) As IQueryable(Of Object)

Parameters

collectionLink
String

The link to the parent collection resource.

querySpec
SqlQuerySpec

The SqlQuerySpec instance containing the SQL expression.

feedOptions
FeedOptions

The options for processing the query result feed. For details, see FeedOptions

Returns

An IQueryable{dynamic} that can evaluate the query with the provided SQL statement.

Examples

This example below queries for user-defined functions by id.

var query = new SqlQuerySpec("SELECT * FROM udfs u WHERE u.id = @id", new SqlParameterCollection(new SqlParameter[] { new SqlParameter { Name = "@id", Value = "sqrt" }}));
UserDefinedFunction udf = client.CreateUserDefinedFunctionQuery(collectionLink, query).AsEnumerable().FirstOrDefault();

Remarks

Refer to https://docs.microsoft.com/azure/cosmos-db/sql-query-getting-started/ for syntax and examples.

See also

Applies to

CreateUserDefinedFunctionQuery(String, String, FeedOptions)

Overloaded. This method creates a query for udfs under a collection in an Azure Cosmos DB database using a SQL statement. It returns an IQueryable{dynamic}.

public System.Linq.IQueryable<dynamic> CreateUserDefinedFunctionQuery (string collectionLink, string sqlExpression, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateUserDefinedFunctionQuery : string * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
Public Function CreateUserDefinedFunctionQuery (collectionLink As String, sqlExpression As String, Optional feedOptions As FeedOptions = Nothing) As IQueryable(Of Object)

Parameters

collectionLink
String

The link to the parent collection resource.

sqlExpression
String

The SQL statement.

feedOptions
FeedOptions

The options for processing the query result feed. For details, see FeedOptions

Returns

An IQueryable{dynamic} that can evaluate the query with the provided SQL statement.

Examples

This example below queries for user-defined functions by id.

UserDefinedFunction udf = client.CreateUserDefinedFunctionQuery(collectionLink, "SELECT * FROM udfs u WHERE u.id = 'sqrt'").AsEnumerable().FirstOrDefault();

Remarks

Refer to https://docs.microsoft.com/azure/cosmos-db/sql-query-getting-started/ for syntax and examples.

See also

Applies to

CreateUserDefinedFunctionQuery(Uri, SqlQuerySpec, FeedOptions)

Method to create a query for user-defined functions in the Azure Cosmos DB service.

public System.Linq.IQueryable<dynamic> CreateUserDefinedFunctionQuery (Uri documentCollectionUri, Microsoft.Azure.Documents.SqlQuerySpec querySpec, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateUserDefinedFunctionQuery : Uri * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
Public Function CreateUserDefinedFunctionQuery (documentCollectionUri As Uri, querySpec As SqlQuerySpec, Optional feedOptions As FeedOptions = Nothing) As IQueryable(Of Object)

Parameters

documentCollectionUri
Uri

The URI of the parent document collection.

querySpec
SqlQuerySpec

The sql query.

feedOptions
FeedOptions

(Optional) The FeedOptions for processing the query results feed.

Returns

The query result set.

Applies to

CreateUserDefinedFunctionQuery(Uri, String, FeedOptions)

Method to create a query for user-defined functions in the Azure Cosmos DB service.

public System.Linq.IQueryable<dynamic> CreateUserDefinedFunctionQuery (Uri documentCollectionUri, string sqlExpression, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateUserDefinedFunctionQuery : Uri * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
Public Function CreateUserDefinedFunctionQuery (documentCollectionUri As Uri, sqlExpression As String, Optional feedOptions As FeedOptions = Nothing) As IQueryable(Of Object)

Parameters

documentCollectionUri
Uri

The URI of the parent document collection.

sqlExpression
String

The sql query.

feedOptions
FeedOptions

(Optional) The FeedOptions for processing the query results feed.

Returns

The query result set.

Applies to