I have been exploring the change stream API and workarounds for my usecase.
What I have understood is that I can detect any change in my collection via change stream “watch” function. I am trying to figure out that how can I read two or more fields from a collection and apply aggregation in the collection and get some result and merge result to another collection. All this based on every change stream event occurring. Every time a change occurs in the collection, I want to re-aggregate the data and store it in another collection again via upsert.
I can do that by Triggers but these are supported in Atlas Only. What other options can I possibly utilize to get this done on my on Premise MongoDB.