JamesOsgood / mongodb-grafana

MongoDB plugin for Grafana
MIT License
464 stars 213 forks source link

modification to can use multivalue of variable with timeseries #94

Open nicho2 opened 4 years ago

nicho2 commented 4 years ago

column name 'ts' is always required, but name can be other than 'value'

ex:

db.IndoorAirQuality_V2.aggregate ( [ { "$match" : { "SenderBuildingEntity.Sentinel": { "$in" : ["$sentinelCO2"]}, "Date": { "$gte" : "$from" } } }, {"$sort" : {"Date" : 1}},

{"$project" : { "name" : "$SenderBuildingEntity.Sentinel", "value" : "$Datas.CO2", "ts" : "$Date", "_id" : 0} } ], {"maxTimeMS":50000,"allowDiskUse":true})