Get a list of all triggers in your application.
Parámetros de path
-
An Atlas Project/Group ID.
-
El ObjectID de tu aplicación. La sección de ID de Proyecto y ID de la aplicación de App Services API muestra cómo encontrar este valor.
Respuestas
-
Listados los activadores correctamente.
Uno de: Ocultar atributos Mostrar atributos
-
El ID único del activador.
-
El nombre del activador.
-
The trigger type. For database triggers, this value is always
"DATABASE".El valor es
DATABASE. -
If
true, the trigger is disabled and does not listen for events or execute.El valor por defecto es
false. -
Un objeto que define los valores de configuración para el activador.
Ocultar atributos de configuración Show config attributes Objeto
-
El valor
_idde una fuente de datos MongoDB vinculada que contiene la colección observada.You can list services with the Get all services endpoint.
Data sources are services whose
typeis "mongodb-atlas". Use the_idvalue for the data source you want to link to the Trigger. -
El nombre de una base de datos en la fuente de datos vinculada. Si omite este parámetro, el tipo de origen cambia a "Implementación". Sin embargo, la infraestructura de nivel compartido no admite flujos de cambios de implementación. Si omite el parámetro "database", recibirá el error "Los flujos de cambios de implementación no son compatibles con los clústeres de nivel compartido". Proporcione el parámetro "database" para resolver este 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."
-
Los tipos de eventos de cambio de MongoDB para los que el disparador escucha.
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"
Los tipos de operación adicionales válidos para los activadores de implementación incluyen:
"DROP_DATABASE"
Para más información, consulta Configuración de activadores.
At least
1element. -
A $match expression filters change events. The trigger will only fire if the expression evaluates to true for a given change event.
-
Una expresión $project devuelve solo los campos especificados. Puede incluir o excluir campos específicos, o incluir campos recién calculados.
-
If
true, indicates thatUPDATEchange events should include the most current majority-committed version of the modified document in thefullDocumentfield.El valor por defecto es
false. -
If true, indicates that
UPDATEchange events should include a snapshot of the modified document from immediately before the update was applied.Debe habilitar las preimágenes de documentos para su clúster para incluir estas instantáneas.
El valor por defecto es
false. -
If
true, enabling the Trigger after it was disabled will not invoke events that occurred while the Trigger was disabled.El valor por defecto es
false. -
Si
true, cuando no se encuentra el token de reanudación de este disparador en el registro de operaciones del clúster, este reanuda automáticamente el procesamiento de eventos en el siguiente evento relevante del flujo de cambios. Todos los eventos del flujo de cambios desde que se suspendió el disparador hasta que este reanude su ejecución no se activan.El valor por defecto es
false. -
Si
true, el activador usará la opción maximizar el rendimiento.El valor por defecto es
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.El valor por defecto es
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.Por ejemplo, si se define
function_id, el backend lo duplica enevent_processors.FUNCTION.function_id.If you define
function_id,event_processorsis not required. You must provide eitherfunction_idorevent_processorswhen 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.Por ejemplo, si se define
function_name, el backend lo duplica enevent_processors.FUNCTION.function_name.If you define
function_name,event_processorsis not required. You must provide eitherfunction_nameorevent_processorswhen 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 Mostrar atributos de event_processors Objeto
-
Ocultar atributo FUNCTION Mostrar atributo FUNCIÓN Objeto
-
Ocultar atributos de configuración Show config attributes Objeto
-
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.Por ejemplo, si se define
event_processors.FUNCTION.function_id, el backend lo duplica enfunction_id.If you define
function_id,event_processorsis not required. You must provide eitherfunction_idorevent_processorswhen 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.Por ejemplo, si se define
event_processors.FUNCTION.function_name, el backend lo duplica enfunction_name.If you define
function_name,event_processorsis not required. You must provide eitherfunction_nameorevent_processorswhen updating a trigger.
-
-
-
Ocultar el atributo AWS_EVENTBRIDGE Show AWS_EVENTBRIDGE attribute Objeto
-
-
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 Mostrar atributo error_handler Objeto
Ocultar atributos Mostrar atributos
-
El ID único del activador.
-
El nombre del activador.
-
The trigger type. For authentication triggers, this value is always
"AUTHENTICATION".El valor es
AUTHENTICATION. -
If
true, the trigger is disabled and does not listen for events or execute.El valor por defecto es
false. -
Un objeto que define los valores de configuración para el activador.
Ocultar atributos de configuración Show config attributes Objeto
-
El tipo de evento de autenticación para el que el activador escucha.
Los valores son
LOGIN,CREATEoDELETE. -
The type(s) of authentication provider that the trigger listens to.
Los valores son
anon-user,api-key,custom-token,custom-function,local-userpass,oauth2-apple,oauth2-facebookooauth2-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.Por ejemplo, si se define
function_id, el backend lo duplica enevent_processors.FUNCTION.function_id.If you define
function_id,event_processorsis not required. You must provide eitherfunction_idorevent_processorswhen 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.Por ejemplo, si se define
function_name, el backend lo duplica enevent_processors.FUNCTION.function_name.If you define
function_name,event_processorsis not required. You must provide eitherfunction_nameorevent_processorswhen 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 Mostrar atributos de event_processors Objeto
-
Ocultar atributo FUNCTION Mostrar atributo FUNCIÓN Objeto
-
Ocultar atributos de configuración Show config attributes Objeto
-
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.Por ejemplo, si se define
event_processors.FUNCTION.function_id, el backend lo duplica enfunction_id.If you define
function_id,event_processorsis not required. You must provide eitherfunction_idorevent_processorswhen 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.Por ejemplo, si se define
event_processors.FUNCTION.function_name, el backend lo duplica enfunction_name.If you define
function_name,event_processorsis not required. You must provide eitherfunction_nameorevent_processorswhen updating a trigger.
-
-
-
Ocultar el atributo AWS_EVENTBRIDGE Show AWS_EVENTBRIDGE attribute Objeto
-
Ocultar atributos Mostrar atributos
-
El ID único del activador.
-
El nombre del activador.
-
The trigger type. For scheduled triggers, this value is always
"SCHEDULED".El valor es
SCHEDULED. -
If
true, the trigger is disabled and does not listen for events or execute.El valor por defecto es
false. -
Un objeto que define los valores de configuración para el activador.
Ocultar atributos de configuración Show config attributes Objeto
-
Una expresión cron que especifica cuándo se ejecuta el disparador.
-
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.Por ejemplo, si se define
function_id, el backend lo duplica enevent_processors.FUNCTION.function_id.If you define
function_id,event_processorsis not required. You must provide eitherfunction_idorevent_processorswhen 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.Por ejemplo, si se define
function_name, el backend lo duplica enevent_processors.FUNCTION.function_name.If you define
function_name,event_processorsis not required. You must provide eitherfunction_nameorevent_processorswhen 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 Mostrar atributos de event_processors Objeto
-
Ocultar atributo FUNCTION Mostrar atributo FUNCIÓN Objeto
-
Ocultar atributos de configuración Show config attributes Objeto
-
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.Por ejemplo, si se define
event_processors.FUNCTION.function_id, el backend lo duplica enfunction_id.If you define
function_id,event_processorsis not required. You must provide eitherfunction_idorevent_processorswhen 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.Por ejemplo, si se define
event_processors.FUNCTION.function_name, el backend lo duplica enfunction_name.If you define
function_name,event_processorsis not required. You must provide eitherfunction_nameorevent_processorswhen updating a trigger.
-
-
-
Ocultar el atributo AWS_EVENTBRIDGE Show AWS_EVENTBRIDGE attribute Objeto
-
-
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"
}
}
}
}
]