Create a trigger
Changed onCreate a new trigger in your application.
Request
- Base URLhttps://services.cloud.mongodb.com/api/admin/v3.0
- URLhttps://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/triggers
- AuthHTTP bearer
Request body
Example request
{
"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"
}
}
}
}Response
Successfully created.
Example response
{
"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"
}
}
}
}Changes
- breaking
the request property
////////became required - breaking
the request property
////////became required - breaking
the request property
////////became required - info
the response property
////////////became required for the status - info
the response property
////////////became required for the status - info
the response property
////////////became required for the status
- breaking
- breaking
the response property
//////////became optional for the status - breaking
the response property
//////////became optional for the status - breaking
the response property
//////////became optional for the status - breaking
the response property
//////////became optional for the status - breaking
the response property
//////////became optional for the status - breaking
the response property
//////////became optional for the status - warning
removed
subschema #1from the request bodyallOflist - info
added to the request body
oneOflist - info
the
response's property default valuefalsewas added for the status - info
removed the
DELETEenum value from the///////////response property for the response status - info
removed the
INSERTenum value from the///////////response property for the response status - info
removed the
REPLACEenum value from the///////////response property for the response status - info
removed the
UPDATEenum value from the///////////response property for the response status
- breaking