Get the configuration for an existing trigger in your application.
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.
El valor único _id de un activador.
Se recuperó correctamente el activador.
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.
El valor _id de una fuente de datos de MongoDB vinculada que contiene la colección supervisada.
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.
El nombre de una base de datos en la fuente de datos vinculada. Si omites este parámetro, el Tipo de Origen cambia a "Implementación". Sin embargo, la infraestructura de nivel compartido no admite los flujos de cambio de implementación. Si omites el parámetro 'database', recibirás el error 'implementación changestreams are not supported on shared nivel clústeres'. Suministra el parámetro de base de datos 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 1 element.
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 that UPDATE change events should include the most current majority-committed version of the modified document in the fullDocument field.
El valor por defecto es false.
If true, indicates that UPDATE change events should include a snapshot of the modified document from immediately before the update was applied.
Debes habilitar preimágenes de documentos para que tu clúster incluya 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 el token de reanudación de este activador no puede encontrarse en el oplog del clúster, el activador reanuda automáticamente el procesamiento de eventos en el siguiente evento relevante del flujo de cambios. Todos los eventos de flujo de cambios ocurridos desde que se suspendió el activador hasta que se reanuda su ejecución no activarán el activador.
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. If false, 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 in event_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 en event_processors.FUNCTION.function_id.
If you define function_id, event_processors is not required. You must provide either function_id or event_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 in event_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 en event_processors.FUNCTION.function_name.
If you define function_name, event_processors is not required. You must provide either function_name or event_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.
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 in function_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 en function_id.
If you define function_id, event_processors is not required. You must provide either function_id or event_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 in function_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 en function_name.
If you define function_name, event_processors is not required. You must provide either function_name or event_processors when updating a trigger.
An object that defines custom error handling for an AWS EventBridge trigger. Valid only for "DATABASE" type triggers with "AWS_EVENTBRIDGE" event processors.
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.
El tipo de evento de autenticación para el que el activador escucha.
Los valores son LOGIN, CREATE o DELETE.
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-facebook o oauth2-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 in event_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 en event_processors.FUNCTION.function_id.
If you define function_id, event_processors is not required. You must provide either function_id or event_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 in event_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 en event_processors.FUNCTION.function_name.
If you define function_name, event_processors is not required. You must provide either function_name or event_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.
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 in function_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 en function_id.
If you define function_id, event_processors is not required. You must provide either function_id or event_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 in function_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 en function_name.
If you define function_name, event_processors is not required. You must provide either function_name or event_processors when updating a trigger.
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.
Una expresión cron que especifica cuándo se ejecuta el activador.
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 in event_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 en event_processors.FUNCTION.function_id.
If you define function_id, event_processors is not required. You must provide either function_id or event_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 in event_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 en event_processors.FUNCTION.function_name.
If you define function_name, event_processors is not required. You must provide either function_name or event_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.
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 in function_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 en function_id.
If you define function_id, event_processors is not required. You must provide either function_id or event_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 in function_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 en function_name.
If you define function_name, event_processors is not required. You must provide either function_name or event_processors when updating a trigger.
curl \
--request GET 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/triggers/{triggerId}' \
--header "Authorization: Bearer $ACCESS_TOKEN"
{
"name": "onNewEmployee",
"type": "DATABASE",
"function_id": "5eea9ca4ca0e356e2c2a148a",
"config": {
"operation_types": [
"INSERT"
],
"database": "HR",
"collection": "employees",
"service_id": "5adeb649b8b998486770ae7c",
"match": {},
"project": {},
"full_document": true
},
"event_processors": {
"FUNCTION": {
"config": {
"function_id": "6841b8d3e71dc81bed89dbba",
"function_name": "Atlas_Triggers_DatabaseInsert_1749137618"
}
}
}
}
{
"name": "onNewApiKey",
"type": "AUTHENTICATION",
"function_id": "5eea9ca4ca0e356e2c2a148a",
"config": {
"operation_type": "CREATE",
"providers": [
"api-key"
]
},
"event_processors": {
"FUNCTION": {
"config": {
"function_id": "6841b8d3e71dc81bed89dbba",
"function_name": "Atlas_Triggers_Auth_Create_1749137618"
}
}
}
}
{
"name": "createDailyReport",
"type": "SCHEDULED",
"function_id": "5eea9ca4ca0e356e2c2a148a",
"config": {
"schedule": "0 8 * * *"
},
"event_processors": {
"FUNCTION": {
"config": {
"function_id": "6841b8d3e71dc81bed89dbba",
"function_name": "Atlas_Triggers_Monthly_1749137618"
}
}
}
}