0

I need to run a function only when all the 4 rows in my container are updated. I have not found anything online about whether it is even possible. It would be very nice if you could tell me if this were possible, and if so how it could be done.

Niv
  • 17
  • 1
  • 5
  • The Change Feed triggers on a per-item basis, so that wouldn't support only running when some set of items are changed. I suspect you'd need just poll, or at least query the set of items when any of them changes to determine whether to run some logic. – Noah Stahl Jul 14 '21 at 16:40

1 Answers1

1

The Trigger delivers a list of changes. That list contains elements that changed between the last time changes were delivered and "now". You cannot define a minimum number of changes or for it to wait until a specific change has occurred.

Unless you are saving those 4 rows as a single transaction (using a Stored Procedure or Transactional Batch), they can be reported as independent batches (one batch can contain 2 and the next one the other 2, depending on when the Trigger reads the Change Feed and the timeline of your 4 operations being saved).

Matias Quaranta
  • 13,907
  • 1
  • 22
  • 47