Get all triggers
Get a list of all triggers in your application.
Path parameters
-
An Atlas Project/Group ID.
-
The ObjectID of your application. The App Services API Project and Application IDs section demonstrates how to find this value.
Responses
-
Successfully listed triggers.
One of: Hide attributes Show attributes
-
The trigger's unique ID.
-
The trigger's name.
-
The trigger type. For database triggers, this value is always
"DATABASE"
.Value is
DATABASE
. -
If
true
, the trigger is disabled and does not listen for events or execute.Default value is
false
. -
An object that defines configuration values for the trigger.
Hide config attributes Show config attributes object
-
The
_id
value of a linked MongoDB data source that contains the watched collection.You can list services with the Get all services endpoint.
Data sources are services whose
type
is "mongodb-atlas". Use the_id
value for the data source you want to link to the Trigger. -
The name of a database in the linked data source. If you omit this parameter, the Source Type changes to "Deployment." However, shared tier infrastructure does not support deployment changestreams. If you omit the 'database' parameter, you receive the 'deployment changestreams are not supported on shared tier clusters' error. Supply the database parameter to resolve this error.
-
The name of a collection in the specified database. The trigger listens to events from this collection. If you omit this parameter, the Source Type changes to "Database."
-
The types of MongoDB change event that the trigger listens for.
Valid operation types for all triggers include:
"INSERT"
"UPDATE"
"REPLACE"
"DELETE"
Additional valid operation types for database and deployment triggers include:
"CREATE_COLLECTION"
"MODIFY_COLLECTION"
"RENAME_COLLECTION"
"DROP_COLLECTION"
"SHARD_COLLECTION"
"RESHARD_COLLECTION"
"REFINE_COLLECTION_SHARD_KEY"
Additional valid operation types for deployment triggers include:
"DROP_DATABASE"
For more information, refer to Trigger Configuration.
At least
1
element. -
A $match expression filters change events. The trigger will only fire if the expression evaluates to true for a given change event.
-
A $project expression returns only the specified fields. You can include or exclude specific fields, or include newly-computed fields.
-
If
true
, indicates thatUPDATE
change events should include the most current majority-committed version of the modified document in thefullDocument
field.Default value is
false
. -
If true, indicates that
UPDATE
change events should include a snapshot of the modified document from immediately before the update was applied.You must enable document preimages for your cluster to include these snapshots.
Default value is
false
. -
If
true
, enabling the Trigger after it was disabled will not invoke events that occurred while the Trigger was disabled.Default value is
false
. -
If
true
, when this Trigger's resume token cannot be found in the cluster's oplog, the Trigger automatically resumes processing events at the next relevant change stream event. All change stream events from when the Trigger was suspended until the Trigger resumes execution do not have the Trigger fire for them.Default value is
false
. -
If
true
, the trigger will use the maximize throughput option.Default value is
false
. -
If
true
, event ordering is disabled and this Trigger can process events in parallel. Iffalse
, event ordering is enabled and the Trigger executes events serially.Default value is
false
.
-
-
The ID of the function that the trigger calls when it fires.
This value is the same as
event_processors.FUNCTION.function_id
. You can either define the value here or inevent_processors.FUNCTION.function_id
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
function_id
, the backend duplicates it toevent_processors.FUNCTION.function_id
.If you define
function_id
,event_processors
is not required. You must provide eitherfunction_id
orevent_processors
when updating a trigger. -
The name of the function that the trigger calls when it fires, i.e. the function described by
function_id
.This value is the same as
event_processors.FUNCTION.function_name
. You can either define the value here or inevent_processors.FUNCTION.function_name
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
function_name
, the backend duplicates it toevent_processors.FUNCTION.function_name
.If you define
function_name
,event_processors
is not required. You must provide eitherfunction_name
orevent_processors
when updating a trigger. -
An object where each field name is an event processor ID and each value is an object that configures its corresponding event processor. For an example configuration object, see Send Trigger Events to AWS EventBridge.
Hide event_processors attributes Show event_processors attributes object
-
Hide FUNCTION attribute Show FUNCTION attribute object
-
Hide config attributes Show config attributes object
-
The ID of the function that the trigger calls when it fires.
This value is the same as the root-level
function_id
. You can either define the value here or infunction_id
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
event_processors.FUNCTION.function_id
, the backend duplicates it tofunction_id
.If you define
function_id
,event_processors
is not required. You must provide eitherfunction_id
orevent_processors
when updating a trigger. -
The name of the function that the trigger calls when it fires, i.e. the function described by
function_id
.This value is the same as the root-level
function_name
. You can either define the value here or infunction_name
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
event_processors.FUNCTION.function_name
, the backend duplicates it tofunction_name
.If you define
function_name
,event_processors
is not required. You must provide eitherfunction_name
orevent_processors
when updating a trigger.
-
-
-
Hide AWS_EVENTBRIDGE attribute Show AWS_EVENTBRIDGE attribute object
-
-
An object that defines custom error handling for an AWS EventBridge trigger. Valid only for
"DATABASE"
type triggers with"AWS_EVENTBRIDGE"
event processors.Hide error_handler attribute Show error_handler attribute object
Hide attributes Show attributes
-
The trigger's unique ID.
-
The trigger's name.
-
The trigger type. For authentication triggers, this value is always
"AUTHENTICATION"
.Value is
AUTHENTICATION
. -
If
true
, the trigger is disabled and does not listen for events or execute.Default value is
false
. -
An object that defines configuration values for the trigger.
Hide config attributes Show config attributes object
-
The type of authentication event that the trigger listens for.
Values are
LOGIN
,CREATE
, orDELETE
. -
The type(s) of authentication provider that the trigger listens to.
Values are
anon-user
,api-key
,custom-token
,custom-function
,local-userpass
,oauth2-apple
,oauth2-facebook
, oroauth2-google
.
-
-
The ID of the function that the trigger calls when it fires.
This value is the same as
event_processors.FUNCTION.function_id
. You can either define the value here or inevent_processors.FUNCTION.function_id
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
function_id
, the backend duplicates it toevent_processors.FUNCTION.function_id
.If you define
function_id
,event_processors
is not required. You must provide eitherfunction_id
orevent_processors
when updating a trigger. -
The name of the function that the trigger calls when it fires, i.e. the function described by
function_id
.This value is the same as
event_processors.FUNCTION.function_name
. You can either define the value here or inevent_processors.FUNCTION.function_name
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
function_name
, the backend duplicates it toevent_processors.FUNCTION.function_name
.If you define
function_name
,event_processors
is not required. You must provide eitherfunction_name
orevent_processors
when updating a trigger. -
An object where each field name is an event processor ID and each value is an object that configures its corresponding event processor. For an example configuration object, see Send Trigger Events to AWS EventBridge.
Hide event_processors attributes Show event_processors attributes object
-
Hide FUNCTION attribute Show FUNCTION attribute object
-
Hide config attributes Show config attributes object
-
The ID of the function that the trigger calls when it fires.
This value is the same as the root-level
function_id
. You can either define the value here or infunction_id
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
event_processors.FUNCTION.function_id
, the backend duplicates it tofunction_id
.If you define
function_id
,event_processors
is not required. You must provide eitherfunction_id
orevent_processors
when updating a trigger. -
The name of the function that the trigger calls when it fires, i.e. the function described by
function_id
.This value is the same as the root-level
function_name
. You can either define the value here or infunction_name
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
event_processors.FUNCTION.function_name
, the backend duplicates it tofunction_name
.If you define
function_name
,event_processors
is not required. You must provide eitherfunction_name
orevent_processors
when updating a trigger.
-
-
-
Hide AWS_EVENTBRIDGE attribute Show AWS_EVENTBRIDGE attribute object
-
Hide attributes Show attributes
-
The trigger's unique ID.
-
The trigger's name.
-
The trigger type. For scheduled triggers, this value is always
"SCHEDULED"
.Value is
SCHEDULED
. -
If
true
, the trigger is disabled and does not listen for events or execute.Default value is
false
. -
An object that defines configuration values for the trigger.
Hide config attributes Show config attributes object
-
A cron expression that specifies when the trigger executes.
-
If
true
, enabling the trigger after it was disabled will not invoke events that occurred while the trigger was disabled.
-
-
The ID of the function that the trigger calls when it fires.
This value is the same as
event_processors.FUNCTION.function_id
. You can either define the value here or inevent_processors.FUNCTION.function_id
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
function_id
, the backend duplicates it toevent_processors.FUNCTION.function_id
.If you define
function_id
,event_processors
is not required. You must provide eitherfunction_id
orevent_processors
when updating a trigger. -
The name of the function that the trigger calls when it fires, i.e. the function described by
function_id
.This value is the same as
event_processors.FUNCTION.function_name
. You can either define the value here or inevent_processors.FUNCTION.function_name
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
function_name
, the backend duplicates it toevent_processors.FUNCTION.function_name
.If you define
function_name
,event_processors
is not required. You must provide eitherfunction_name
orevent_processors
when updating a trigger. -
An object where each field name is an event processor ID and each value is an object that configures its corresponding event processor. For an example configuration object, see Send Trigger Events to AWS EventBridge.
Hide event_processors attributes Show event_processors attributes object
-
Hide FUNCTION attribute Show FUNCTION attribute object
-
Hide config attributes Show config attributes object
-
The ID of the function that the trigger calls when it fires.
This value is the same as the root-level
function_id
. You can either define the value here or infunction_id
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
event_processors.FUNCTION.function_id
, the backend duplicates it tofunction_id
.If you define
function_id
,event_processors
is not required. You must provide eitherfunction_id
orevent_processors
when updating a trigger. -
The name of the function that the trigger calls when it fires, i.e. the function described by
function_id
.This value is the same as the root-level
function_name
. You can either define the value here or infunction_name
. The App Services backend duplicates the value to the configuration location where you did not define it.For example, if you define
event_processors.FUNCTION.function_name
, the backend duplicates it tofunction_name
.If you define
function_name
,event_processors
is not required. You must provide eitherfunction_name
orevent_processors
when updating a trigger.
-
-
-
Hide AWS_EVENTBRIDGE attribute Show AWS_EVENTBRIDGE attribute object
-
-
curl \
--request GET 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/triggers' \
--header "Authorization: Bearer $ACCESS_TOKEN"
[
{
"name": "onNewEmployee",
"type": "DATABASE",
"config": {
"match": {},
"project": {},
"database": "HR",
"collection": "employees",
"service_id": "5adeb649b8b998486770ae7c",
"full_document": true,
"operation_types": [
"INSERT"
]
},
"function_id": "5eea9ca4ca0e356e2c2a148a",
"event_processors": {
"FUNCTION": {
"config": {
"function_id": "6841b8d3e71dc81bed89dbba",
"function_name": "Atlas_Triggers_DatabaseInsert_1749137618"
}
}
}
}
]