title: Mongo GridFS How to delete files older than a given date?
body: <p>I came by this problem on how to delete files older than a certain date and couldn't find a quick answer on the web, so here I'm posting the question and answering it, hopefully it'll save someone 15 minutes at some point.</p>
  
  <p>Essentially I wanted to have the behavior of the following command (delete files older than five days) kind thing</p>
  
  <pre><code>find /path/to/files* -mtime +5 -exec rm {} \;
  </code></pre>
  
  <p>but in mongo.</p>