-
Notifications
You must be signed in to change notification settings - Fork 0
/
garbage.txt
43 lines (38 loc) · 1.22 KB
/
garbage.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
var req = https.request(reqhttp,(res)=>{
console.log('statusCode:', res.statusCode);
console.log('headers:', res.headers);
})
req.on('error', (e) => {
console.error(e);
});
req.end();
}
model.find({ wid: widbody }, (err, docs) => {
if (err) {
console.log("error in finding")
}
else {
console.log("documents found")
console.log(docs[0].task)
console.log(typeof (docs[0].task))
records = docs[0].task
console.log("type of records")
console.log(typeof (records))
console.log("type of new records")
console.log(typeof (newrecords))
console.log("Pushing in the new records")
records = Object.assign(newrecords,records)
model.findOneAndUpdate({ wid: widbody }, { task: records }, (err, docs) => {
if (err) {
console.log("error in updating")
console.log(err)
res.send("false")
}
else {
console.log("updated")
res.send("true")
}
})
}
})
}