Triggers class

Operations to create, upsert, query, and read all triggers.

Use container.triggers to read, replace, or delete a Trigger.

Properties

container

Methods

create(TriggerDefinition, RequestOptions)

Create a trigger.

Azure Cosmos DB supports pre and post triggers defined in JavaScript to be executed on creates, updates and deletes.

For additional details, refer to the server-side JavaScript API documentation.

query(SqlQuerySpec, FeedOptions)

Query all Triggers.

query<T>(SqlQuerySpec, FeedOptions)

Query all Triggers.

readAll(FeedOptions)

Read all Triggers.

Example

Read all trigger to array.

const {body: triggerList} = await container.triggers.readAll().fetchAll();

Property Details

container

container: Container

Property Value

Method Details

create(TriggerDefinition, RequestOptions)

Create a trigger.

Azure Cosmos DB supports pre and post triggers defined in JavaScript to be executed on creates, updates and deletes.

For additional details, refer to the server-side JavaScript API documentation.

function create(body: TriggerDefinition, options?: RequestOptions): Promise<TriggerResponse>

Parameters

options
RequestOptions

Returns

Promise<TriggerResponse>

query(SqlQuerySpec, FeedOptions)

Query all Triggers.

function query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>

Parameters

query
SqlQuerySpec

Query configuration for the operation. See SqlQuerySpec for more info on how to configure a query.

options
FeedOptions

Returns

query<T>(SqlQuerySpec, FeedOptions)

Query all Triggers.

function query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>

Parameters

query
SqlQuerySpec

Query configuration for the operation. See SqlQuerySpec for more info on how to configure a query.

options
FeedOptions

Returns

readAll(FeedOptions)

Read all Triggers.

Example

Read all trigger to array.

const {body: triggerList} = await container.triggers.readAll().fetchAll();
function readAll(options?: FeedOptions): QueryIterator<TriggerDefinition & Resource>

Parameters

options
FeedOptions

Returns