DocumentClient.CreateTriggerQuery Method

Definition

Overloads

CreateTriggerQuery(Uri, String, FeedOptions)

Extension method to create query for triggers in the Azure Cosmos DB service.

CreateTriggerQuery(Uri, SqlQuerySpec, FeedOptions)

Extension method to create query for triggers in the Azure Cosmos DB service.

CreateTriggerQuery(String, String, FeedOptions)

Overloaded. This method creates a query for triggers under a collection in an Azure Cosmos DB service. It returns an IQueryable{dynamic}.

CreateTriggerQuery(Uri, FeedOptions)

Extension method to create query for triggers in the Azure Cosmos DB service.

CreateTriggerQuery(String, FeedOptions)

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

CreateTriggerQuery(String, SqlQuerySpec, FeedOptions)

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

CreateTriggerQuery(Uri, String, FeedOptions)

Extension method to create query for triggers in the Azure Cosmos DB service.

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

Parameters

triggersUri
Uri

the URI to the triggers.

sqlExpression
String

The sql query.

feedOptions
FeedOptions

The options for processing the query results feed.

Returns

The query result set.

Implements

Applies to

CreateTriggerQuery(Uri, SqlQuerySpec, FeedOptions)

Extension method to create query for triggers in the Azure Cosmos DB service.

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

Parameters

triggersUri
Uri

the URI to the triggers.

querySpec
SqlQuerySpec

The sql query.

feedOptions
FeedOptions

The options for processing the query results feed.

Returns

The query result set.

Implements

Applies to

CreateTriggerQuery(String, String, FeedOptions)

Overloaded. This method creates a query for triggers under a collection in an Azure Cosmos DB service. It returns an IQueryable{dynamic}.

public System.Linq.IQueryable<dynamic> CreateTriggerQuery (string collectionLink, string sqlExpression, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateTriggerQuery : string * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
override this.CreateTriggerQuery : string * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
Public Function CreateTriggerQuery (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.

Implements

Examples

This example below queries for triggers by id.

Trigger trigger = client.CreateTriggerQuery(collectionLink, "SELECT * FROM triggers t WHERE t.id = 'validate'").AsEnumerable().FirstOrDefault();

Remarks

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

See also

Applies to

CreateTriggerQuery(Uri, FeedOptions)

Extension method to create query for triggers in the Azure Cosmos DB service.

public System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.Trigger> CreateTriggerQuery (Uri triggersUri, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateTriggerQuery : Uri * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.Trigger>
override this.CreateTriggerQuery : Uri * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.Trigger>
Public Function CreateTriggerQuery (triggersUri As Uri, Optional feedOptions As FeedOptions = Nothing) As IOrderedQueryable(Of Trigger)

Parameters

triggersUri
Uri

the URI to the triggers.

feedOptions
FeedOptions

The options for processing the query results feed.

Returns

The query result set.

Implements

Applies to

CreateTriggerQuery(String, FeedOptions)

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

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

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{Trigger} that can evaluate the query with the provided SQL statement.

Implements

Examples

This example below queries for triggers by id.

Trigger trigger = client.CreateTriggerQuery(collectionLink).Where(t => t.Id == "validate").AsEnumerable().FirstOrDefault();

See also

Applies to

CreateTriggerQuery(String, SqlQuerySpec, FeedOptions)

Overloaded. This method creates a query for triggers under a collection in an Azure Cosmos DB database using a SQL statement 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> CreateTriggerQuery (string collectionLink, Microsoft.Azure.Documents.SqlQuerySpec querySpec, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateTriggerQuery : string * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
override this.CreateTriggerQuery : string * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
Public Function CreateTriggerQuery (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{Trigger} that can evaluate the query with the provided SQL statement.

Implements

Examples

This example below queries for triggers by id.

var query = new SqlQuerySpec("SELECT * FROM triggers t WHERE t.id = @id", new SqlParameterCollection(new SqlParameter[] { new SqlParameter { Name = "@id", Value = "HelloWorld" }}));
Trigger trigger = client.CreateTriggerQuery(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