mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-11 18:32:50 +00:00
fixed api get request
This commit is contained in:
@@ -9,9 +9,9 @@ var temperature = mongoose.model('temperature');
|
|||||||
/* GET sensors page. */
|
/* GET sensors page. */
|
||||||
router.get('/tempsensors', function(req, res, next) {
|
router.get('/tempsensors', function(req, res, next) {
|
||||||
|
|
||||||
var location = request.query.location;
|
//var location = req.query.location;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
temperature.aggregate([ {$sort : {location : -1, updated : -1}},
|
temperature.aggregate([ {$sort : {location : -1, updated : -1}},
|
||||||
{ $group : { _id : {location : "$location", month: {$month: "$updated" }, day: { $dayOfMonth: "$updated" }, year: { $year: "$updated" }},
|
{ $group : { _id : {location : "$location", month: {$month: "$updated" }, day: { $dayOfMonth: "$updated" }, year: { $year: "$updated" }},
|
||||||
max : {$max : "$temperature"},
|
max : {$max : "$temperature"},
|
||||||
|
|||||||
Reference in New Issue
Block a user