明树Git Lab

Commit 50737437 authored by zfp1's avatar zfp1

update

parent c85a1674
...@@ -404,16 +404,20 @@ async function getEnvironmentalTrend(req, res, next) { ...@@ -404,16 +404,20 @@ async function getEnvironmentalTrend(req, res, next) {
{ {
$group: { $group: {
_id: { $dateToString: { format: "%Y-%m-%d", date: "$time", timezone: "+08:00" } }, // 将时间戳转换为日期字符串 _id: { $dateToString: { format: "%Y-%m-%d", date: "$time", timezone: "+08:00" } }, // 将时间戳转换为日期字符串
miCcrobialCount: { $avg: "$miCcrobialCount" }, pm10: { $avg: "$pm10" },
particleConcentration: { $avg: "$particleConcentration" }, pm25: { $avg: "$pm25" },
chemicalPollutant: { $avg: "$chemicalPollutant" }, O3: { $avg: "$O3" },
temp: { $avg: "$temp" },
hum: { $avg: "$hum" },
} }
}, },
{ {
$project: { $project: {
miCcrobialCount: { $round: ["$miCcrobialCount", 2] }, pm10: { $round: ["$pm10", 2] },
particleConcentration: { $round: ["$particleConcentration", 2] }, pm25: { $round: ["$pm25", 2] },
chemicalPollutant: { $round: ["$chemicalPollutant", 2] }, O3: { $round: ["$O3", 2] },
temp: { $round: ["$temp", 2] },
hum: { $round: ["$hum", 2] },
} }
}, },
{ $sort: { _id: 1 } } { $sort: { _id: 1 } }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment