Triggers not working with Global Deployment

Hi, I am pretty sure that there should be no difference in the trigger for local vs global deployment and your trigger should definitely work regardless of your cluster tier. We do some rate limiting and limit the number of triggers you can have, but you have not hit those.

I think that Manny is correct and this issue is more about your match expression. If I understand correctly, removing the match expression led to your trigger firing correctly, so the conclusion of that experiment is not that “the trigger not firing is related to the cluster size”, but rather that the match expression is likely misconfigured.

Match expressions can admittedly be tricky. One thing that stands out is that your trigger is configured for Insert, Replace, and Update events, but your match expression is:

{"updateDescription.updatedFields._modifiedTS":{"$exists":false}}

This match expression will only pass for an update event where one of the modified fields is “_modifiedTS”. If something is inserted or replaced (and many tools like Compass are replacing objects, not updating them) then the match expression here will skip over the event (as designed). I see that you have specific logic in your function for handling insert events so I suspect this is the issue. This also explains why removing the match expression led to the execution of your trigger.

I think it is worth pointing out that the Match Expression is more of a power-user feature in order to prevent the trigger from firing too much under a lot of load; however, it can be tricky to configure given it is a filter on the Change Event’s which are not something people are used to interacting with much. Therefore, I often advise people to use no Match Expression and instead write the filtering logic directly into the function where you have more control and understanding of the input.

If you do want to continue with the Match Expression, can you clarify a few things:

  1. Can you clarify the goal of your trigger? When do you want it to run exactly?
  2. What events are you not seeing come through? Are they updates, inserts, deletes, etc? How are you making these modifications?

Thanks,
Tyler