I am trying to use Eventing for calculating some stats. The scenario is the following:
- Save raw data in Bucket_1. Bucket_1 contains documents for multiple customers.
- OnUpdate function in Eventing kick in.
- Calculation in OnUpdate function should only calculate and update data for the customer that we saved in Step 1, thus processing only part of the bucket content.
- Save calculated stats in Bucket_2.
While debugging, I deleted the all the content (calculated stats) in Bucket_2., and noticed that when I added new document for customer in Bucket_1, I get in results Bucket_2 calculated stats for all existing customers from Bucket_1.
Tested this several times: by not deleting all results documents in Bucket_2 and added timestamps within results document to trace are they are all being updated on update of 1 document. Every time Update function kicks in for 1 customer, all customers results stats docs get new timestamp as well.
Questions:
- Is it expected behavior for Update Eventing function when all docs get reprocessed.
- If it is expected is there way to limit the processing of the documents only for the customer that is being added/updated.
Thank you