correct typo, remove 'whatTable'
This commit is contained in:
+10
-4
@@ -187,7 +187,7 @@ export const fetchgeigerAVGData = async (opts) => {
|
||||
let sorting = {datetime: opts.sort};
|
||||
let client = await connectMongo()
|
||||
try {
|
||||
if(opts.mooving) {
|
||||
if(opts.moving) {
|
||||
docs = await client.db(MONGOBASE).collection('sensors').aggregate([
|
||||
{
|
||||
$sort: sorting
|
||||
@@ -213,8 +213,11 @@ export const fetchgeigerAVGData = async (opts) => {
|
||||
}
|
||||
},
|
||||
{
|
||||
$project: {_id:0, cpm_avg: 1, datetime:1, uSvph_avg: { $multiply: ["$cpm_avg", opts.factor]}
|
||||
}
|
||||
$project: {_id:0, cpm_avg: 1, datetime:1, uSvph_avg: { $multiply: ["$cpm_avg", opts.factor]}}
|
||||
},
|
||||
{
|
||||
$sort: {datetime: 1}
|
||||
}
|
||||
]).toArray();
|
||||
} else {
|
||||
docs = await client.db(MONGOBASE).collection('sensors').aggregate([
|
||||
@@ -239,7 +242,10 @@ export const fetchgeigerAVGData = async (opts) => {
|
||||
{ $addFields: { datetime: "$_id"}}, // change '_id' to 'datetime
|
||||
{
|
||||
$project: {_id:0, uSvph_avg: { $multiply: ["$cpm_avg", opts.factor]}, datetime: 1, cpm_avg: 1}
|
||||
}
|
||||
},
|
||||
{
|
||||
$sort: {datetime: 1}
|
||||
}
|
||||
]).toArray();
|
||||
}
|
||||
} catch(e) { // if there was an error
|
||||
|
||||
Reference in New Issue
Block a user