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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user