MongoDB.live, free & fully virtual. June 9th - 10th. Register Now MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Stitch Update Trigger on Subdocument

Hi there,

This seems really silly but I just can’t figure it out. I want my update stitch trigger to fire on a nested field, is that possible?

My particular use case is field subscriptionStatus in object subscription.
I’ve tried:
{"updateDescription.updatedFields": {"subscription.subscriptionStatus":"current"} }
and
{"updateDescription.updatedFields.subscription.subscriptionStatus":"current"}
But neither fire, despite when removing the match expression and logging the result of the expected update gives:
{"removedFields":[],"updatedFields":{"subscription.endDate":"2020-06-07T12:02:10.440Z", "subscription.subscriptionStatus":"current"}...}
So it’s definitely there, what am I missing?
Thanks in advance

Hi Carla – I believe the correct match syntax is as follows, can you try this and let me know if it works –

{
  "updateDescription": {
    "updatedFields": {
      "subscription": {
        "subscriptionStatus":"current" 
      }
    }
  }
}
1 Like