I want to use MongoDB such as it is like a database version of a spreadsheet with cells: groups of data involved in sum calculations, or inventory with a running total from a document to the next. (of course, other calculation types can be expected)
It means everytime we get an insert/edit/delete it is needed to run the re-calculation for something that is maybe involved in a further calculation thus, the result might be itself a trigger for another re-calculation.
Is there a built-in way to test insert/edit/delete that would call re-calculation methods? (maybe in cascade if a result has an effect on a next re-calculation)
I suppose, such trigger would call a specific function and would supply it with: Attribute name (inserted/edited/deleted), Collection, Document ID, operation type and maybe previous and new values)
(attribute and document level triggers)
I suppose, another way to see it is have a recurring function constantly reading oplog files and act accordingly.
Thanks, Marc