1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-10 18:02:51 +00:00

reverted changes - will work on another time

This commit is contained in:
2016-01-21 19:38:12 -06:00
parent fe1e896462
commit 3a5cd6e408

View File

@@ -9,8 +9,7 @@ var temperature = mongoose.model('temperature');
/* GET sensors page. */
router.get('/', function(req, res, next) {
temperature.aggregate( [{$project : {location : 1, temperature : 1, humidity : 1, sDate : {$subtract : ["$updated", 21600000]}}},
{ $group : { _id : "$location", temperature : {$last : "$temperature"}, humidity : {$last : "$humidity"}, updated : {$last : "$sDate"}}},
temperature.aggregate( [{ $group : { _id : "$location", temperature : {$last : "$temperature"}, humidity : {$last : "$humidity"}, updated : {$last : "$updated"}}},
{$sort : {location : -1, updated : -1}} ] ).exec(function(err, info){
//get month for each entry and convert 24 hour time to US time