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

fixed Get temperature by location api function

This commit is contained in:
2015-12-19 01:45:43 -06:00
parent da4140ddea
commit 78f5e35270

View File

@@ -32,7 +32,7 @@ router.get('/sensorbylocation', function(req, res, next) {
{$group : { _id : {location : "$location", month: {$month: "$updated" }, day: { $dayOfMonth: "$updated" }, year: { $year: "$updated" }},
max : {$max : "$temperature"},
min : {$min : "$temperature"}}},
{$sort : {"_id.month" : -1}}]).exec(function(err, info){
{$sort : {"_id.month" : -1, "_id.day" : -1, "_id.year" : -1}}]).exec(function(err, info){
console.log(info);
res.setHeader('Content-Type', 'application/json');