From 711c3b542c74ef8532fda306e35f13140335c5b3 Mon Sep 17 00:00:00 2001 From: mgerb42 Date: Sat, 19 Dec 2015 01:45:43 -0600 Subject: [PATCH] fixed Get temperature by location api function --- routes/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/api.js b/routes/api.js index 430c58b..844f9f4 100644 --- a/routes/api.js +++ b/routes/api.js @@ -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');