0

He guys,

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?

{
  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}
  }
}
Mutex
  • 430
  • 2
  • 5
  • 14

1 Answers1

0

You can use MongoDB Aggregation for aggregate data and for this task you can useMongoDB Aggregation date.

Here is a similar problem Group result by 15 minutes time interval

Dorin
  • 2,167
  • 4
  • 20
  • 32