I want to use the MongoDB Atlas trigger, but it should only apply to Device Sync. For example, Suppose the insert, update, and delete are comming from Device Sync. In that case, the trigger will be executed, but if comming from Graphql or direct insert, update, and delete, the trigger will not be executed. How can I do that?
Hi Chris,
Thanks for posting and welcome to the community.
One way to achieve this is to add a boolean field to your documents called “deviceSyncOrigin” and set it to true when you’re making a write via a sync client. You can then set a match expression on the trigger if this field is set to true.
Hope that helps.
Regards
Manny
Hello @Mansoor_Omar, Thanks, that’s awesome! One last question: I know the trigger pricing is based on every time the trigger is executed. If the expression does not match, will you still be billed?
Hi Chris,
It would only be included if the trigger executes which would need the match expression to be matched.
Here is a link to the App Services billing page for your convenience:
Regards
Manny
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.