I have two collections named graphData and users. 'users' collection has documents that store the user information. 'graphData' has 10 documents initially that has some dummy data regarding the number of users in the last 10 days. Now, I want a query to fire automatically after 24 hours that finds the number of users at that time and adds it to graphData and deletes one document also (using TTL index, I figured that out)
Please tell if there is some way to do this. Thanks I am using MERN stack (MongoDB, Express, ReactJS and NodeJS)