Ability to create and update database triggers via API
It would be really usefule to have the ability to create and update database triggers via the API. Currently, updates to triggers cannot be integrated into our testing and deployment process because the only way to update them is manually through the interface.
-
Ashish commented
I am not sure if you use node or not but in case you do, you could use following package to insert/update/delete triggers
https://www.npmjs.com/package/mongodb-stitch-api-client
This internall uses stitch/realm admin api.
-
Dev commented
@Drew Not to hijack this thread, but at least for our use case I don't think the Stitch Admin API would suit our purposes. We don't use realm/stitch apps; we just want to be able to configure triggers to operate on our clusters.
I see that when we create a trigger on one of our clusters, a "Triggers_RealmApp" automatically appears in the "Realm" tab of the UI, but issuing a GET to the 'https://realm.mongodb.com/api/admin/v3.0/groups/{groupId}/apps'; API endpoint as specified on https://docs.mongodb.com/realm/admin/api/v3/#get-/groups/{groupid}/apps returns an empty response.
-
Brian commented
If Triggers were supported by the Atlas API they would also then be theoretically supported by the CLI (https://docs.mongodb.com/mongocli/stable/reference/#mcli-reference). Or are there plans for the CLI to also cover Stitch?
-
AdminDrew (Admin, MongoDB) commented
Hi John – We expose Triggers through the Stitch Admin API, you can read a bit more about the available endpoints here –
https://docs.mongodb.com/stitch/admin/api/admin-v3/#event-trigger-apis
Does this meet your needs?
Thanks,
Drew