title: Mongodb time series data aggregation
body: <p>He guys, </p>
  
  <p>I have a following time series mongodb data. This is one day of some measurements. I need to aggregate this data by some interval (e.g. 15 minutes) for the last x hours. Could you help me?</p>
  
  <pre><code>{
    timestamp_hour: ISODate("2013-10-10T23:00:00.000Z"),
    type: “spot_EURUSD”,
    values: {
      0: { 0: 1.2343, 1: 1.2343, …, 59: 1.2343},
      1: { 0: 1.2343, 1: 1.2343, …, 59: 1.2343},
      …,
      22: { 0: 1.2343, 1: 1.2343, …, 59: 1.2343},
      23: { 0: 1.2343, 1: 1.2343, …, 59: 1.2343}
    }
  }
  </code></pre>