time-series 数据的流星 simple-schema

meteor simple-schema fpr time-series data

我是流星的初学者。 我想在 meteor 中获取一个数据库 collection,用于 time-series 数据,例如 MongoDb Blog。他们已经解释了一个 Mongo 模式,它应该适用于时间序列数据。 Collection 应如下所示:

{
  timestamp_minute: ISODate(“2013-10-10T23:06:00.000Z”),
  num_samples: 58,
  total_samples: 108000000,
  type: “memory_used”,
  values: {
    0: 999999,
    …  
    37: 1000000,
    38: 1500000,
    … 
    59: 1800000
  }
}

除了值字段,所有字段都很容易获得。

两个问题:

我是否必须为值字段创建自己的架构? 喜欢

sensorValues = new SimpleSchema ({
      0: {
          type: Number
      },
      ...,
      59: {
          type: Number
      }
})  

第二:如果是,为什么我不能访问 values.0 而我必须使用像 values.value0 这样的字符串 并且必须像这样更改模式?

sensorValues = new SimpleSchema ({
      values0: {
          type: Number
      },
      ...,
      values59: {
          type: Number
      }
})

也许有人可以帮我得到 Collection 就像在流星博客上解释的那样。

感谢您的帮助。

问候 迈克尔

您可以将值定义为数字数组。

values: {
type: [Number]
}