1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-11 18:32:50 +00:00

fixed charts

This commit is contained in:
2015-12-20 21:50:17 -06:00
parent daab977655
commit 31ad768941
3 changed files with 11 additions and 6 deletions

View File

@@ -78,7 +78,7 @@ router.get('/information', function(req, res, err){
temperature.aggregate([{$project : {location : "$location", year : {$year : "$updated"}, month : {$month : "$updated"}}},
{$match : {location : sensor_location}},
{$group : {_id : {year : "$year", month : "$month", location : "$location"}}},
{$sort : {"_id.year" : 1, "_id.month" : 1}}]).exec(function(err, info){
{$sort : {"_id.year" : -1, "_id.month" : -1}}]).exec(function(err, info){
console.log(info);
//generate list of unique years to display in dropdown menu