title: How to update a MongoDB collection automatically every midnight?
body: <p>I currently have an SPA built with MERN and I want to improve it further by adding a scheduled update to a particular collection in my MongoDB database by setting a <code>boolean</code> field in all of the documents in a collection to false every midnight.</p>
  
  <p>Can someone point me to the right direction on how to accomplish this? </p>
  
  <p>I want to be able to scale it as well at some point - for example, have a value saved in a document in another collection to indicate the time where these <code>boolean</code> fields will be invalidated in the front end?</p>
  
  <p>I'm using a MERN stack. Thanks for your help!</p>