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之間,那麼我將按秒分組,如分鐘,按時間和按天分組。
這就是我想感謝工作完美! –