Hi guys,
I want to query the data based on time, so i tried group by time(15mins) with match followed by group query.
Group by time: 15 mins
{$group: {_id: {"date": {"$subtract": [{"$toLong": {"$toDate": "$timeStamp"}}, {"$mod": [{"$toLong": {"$toDate": "$timeStamp"}},900000]}]}},value:{$avg:{"$divide": ["$rvalue",1000]}}}}
This gives me timeStamp with millisec
and avg value.
But now I want a query where group by time and offset…query similar to influx group by time(time_intervel,offset_interval)
example influx query:
SELECT MEAN("water_level") FROM "h2o_feet"
WHERE "location"='coyote_creek'
AND time >= '2015-08-18T00:06:00Z'
AND time <= '2015-08-18T00:54:00Z'
GROUP BY time(18m,6m)