明树Git Lab

Commit 18c3ecd1 authored by zfp1's avatar zfp1

update

parent 3a362973
...@@ -28,16 +28,20 @@ async function count(search) { ...@@ -28,16 +28,20 @@ async function count(search) {
async function insertHQData(data) { async function insertHQData(data) {
if(!(data.deviceNumber && data.time)) { try {
return; if(!(data.deviceNumber && data.time)) {
return;
}
// return await DB.CollectSMC.findOneAndUpdate({time: data.time}, data, {upsert: true})
let check = await DB.CollectSMC.findOne({time: data.time});
if(!check) {
// 没有就新增
await DB.CollectSMC.create(data);
}
return !!check;
} catch (error) {
console.log(error);
} }
// return await DB.CollectSMC.findOneAndUpdate({time: data.time}, data, {upsert: true})
let check = await DB.CollectSMC.findOne({time: data.time});
if(!check) {
// 没有就新增
await DB.CollectSMC.create(data);
}
return !!check;
} }
......
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