Hi,
I’m trying to create a database trigger using the Atlas App Services. I’m having trouble getting my trigger to fire when I use a match expression.
Below is the match expression:
{
"updateDescription.updatedFields.data.currStreak": {
"$exists": true
}
}
So basically I want the trigger to fire for any change in data.currStreak
. Please note that currStreak
is an integer
. This is not working. But if I remove the match expression then I can see the triggers in my logs. I tried printing the changeEvent
and below is one such event
{
"_id": {
"_data": "8263BE37C6000000042B022C0100296E5A10046DB0EBA4EE3541A0A0DA37F2FA1A1B23463C5F6964003C363339633161333537666161383162633466613961373730000004"
},
"operationType": "update",
"clusterTime": {
"$timestamp": {
"t": 1673410502,
"i": 4
}
},
"ns": {
"db": "<my_db>",
"coll": "users"
},
"documentKey": {
"_id": "639c1a357faa81bc4fa9a770"
},
"updateDescription": {
"updatedFields": {
"data.currStreak": 11
},
"removedFields": [
"_id__baas_transaction"
],
"truncatedArrays": []
}
}
What can be the issue when the change event is showing the same thing which I wanted with the match expression?
NOTE: I’m on a FREE SHARED CLUSTER. Will that have any effect on this behavior?
Thanks,
Rajeev