Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am storing time series data (machine monitoring data) with MongoDB. The data model looks like the following,which is inspired by the internet article "MongoDB as a Time Series Database"
{
  timestamp_hour: ISODate("2013-10-10T23:00:00.000Z"),
  type: "Voltage",
  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}
  }
}

In this manner, monitoring data is bucketed by time period.
To support queries on time range and voltage value, e.g., searching records that falling time range from 2011-10-21 00:00:00 to 2011-10-31 23:59:59, and voltage value larger than 32V, I need to create index on value. However, "values" is a nested field. I am wondering how to create index on this kind of value.
Posted
Comments

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900