I am trying to solve a use case which needs to capture certain data points from MongoDB and update an array of size 5 which is updated for 5 mins and then flushed and again