title: How can I reduce Mongo db by averaging out old data
body: <p>I have a mongodb for measurements which has a document per measurements. Each doc looks like:</p>
  
  <pre><code>{
   timestamp : 123
   value     : 123
   meta1     : something
   meta2     : something
  }
  </code></pre>
  
  <p>I get measurements from a number of sources every second, and so the db gets quite large, quickly. I'm interested in keeping the recent information at the frequency it was read in, but older data, i would like to average out periodically to save space, and make the db a bit quicker.</p>
  
  <p>1.Whats the best approach in mongo?</p>
  
  <p>2.Is there a better db for this, considering that the schema is different for different measurements, and a fixed format wouldn't work very well. RRD is also not an option as i need the dynamic query abilities.?</p>