MongoDB Trigger not firing

Hello. I have a problem with my mongoDB trigger on production. Somehow it doesn’t get fired on certain documents and i can’t figure out why. Mentioning that i have about 500K triggers firing every day. Is it a limitation or something? This doesn’t happen on my other enviornments.

Hi @Ciprian_Stanciu,

MongoDB Realm limits the execution of Trigger Functions to a rate of 1000 executions per second across all Triggers in an application. If additional Triggers fire beyond this threshold, MongoDB Realm adds their associated Function calls to a queue and executes the Function calls once capacity becomes available.

Are the triggers not happening on specific operations ir specific times?

Can you link the application.


Hello Pavel,

i’ve read about that threshold but i don’t think we have so many triggers happening per second. The triggers are not happening on specific documents from what i saw.
Here is a link to the application: Cloud: MongoDB Cloud


@Ciprian_Stanciu What is the significance of those documents and what operations are expected to trigger the code?


Those documents are just some numeric values. The trigger should fire at every update/insert/replace and calculate a sum accoring to the values in the counters.

Here is an example of a document from the “stock” collection on which the trigger didn’t work yesterday, but today when there aren’t so many triggers it is working.


Hi there!

I have the same problem of trigger not firing.
I’m using realm sync in an iOS app. The trigger is expected to fire on the write operation in order to modify a field in my document. The trigger is firing most of the time but sometimes it stops working or is working very bad and after some times it starts working well again (without doing anything).

I’m using a Shared Tier Cluster so I was wondering if this can be the cause.

Thanks for your help!

There are lots of additional limitations in the Shared Tier Cluster. Maybe related to one of these many limits. This list shows them: