0
mongodate
我insertd数据集团在MongoDB中
{ "_id" : ObjectId("5992e6f52479d56b0b2709bf"),
"TIMESTAMP" : ISODate("2017-08-15T12:19:25.680+0000"),
"RECORD" : 20507361.0,
"BattV_Min" : 11.9,
"SEVolt" : 0.0
}
和我用于获取日期查询
$collection1 = $db->tablename;
$filter1 = array('timestamp' => array('$gte' => $acst1, '$lte' => $acst2));
$options1 = array('projection' => array('_id' => 0,'temperature' => 1,timestamp => 1));
$oresult = $collection1->find($filter1,$options1);
我在数十亿获取数据,所以我想优化使用GROUP BY方法我的查询,就像我有70000以下的数据一样,如果我的数据范围在70000到100000之间,那么我将按秒分组,如分钟,按时间和按天分组。
这就是我想感谢工作完美! –