Trigger a function written in python

Hello,

I would like to know, If I can a schedule a trigger or database trigger
if code is written in python in the external editor.

For example: I have written a code using python in vs code by making use of pymongo, that function does some job and now I would like to schedule it to run the program either by timely basis or if there is any change in database.
(there is a option in Atlas for trigger the function which supports node js, similarly would like to know
if can do the same for the function written in python).
Any help would be helpful.
Thank you

Hi @SHANMUKHA_K_H and welcome to the MongoDB community forum!!

If I understand your question correctly, you are looking to set up the Triggers using Python for your application.
We have an Admin API that allows you to construct triggers, thus combining it with a typical Python HTTP client could be useful here.

https://www.mongodb.com/docs/atlas/app-services/admin/api/v3/#tag/triggers/operation/adminCreateTrigger

Please let me know if my understanding is wrong here.

Regards
Aasawari

Can we write the trigger function in python?

1 Like