1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

Update 66-mongodb.js

Call done when the operation is complete
This commit is contained in:
dodois 2021-07-20 11:35:15 +08:00 committed by GitHub
parent 8604a783a4
commit b82f773d04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,6 +115,8 @@ module.exports = function(RED) {
coll.save(msg.payload,function(err, item) {
if (err) {
node.error(err,msg);
}else {
node.done();
}
});
}
@ -122,6 +124,8 @@ module.exports = function(RED) {
coll.save(msg,function(err, item) {
if (err) {
node.error(err,msg);
}else {
node.done();
}
});
}
@ -137,6 +141,8 @@ module.exports = function(RED) {
coll.insert(msg.payload, function(err, item) {
if (err) {
node.error(err,msg);
}else {
node.done();
}
});
}
@ -144,6 +150,8 @@ module.exports = function(RED) {
coll.insert(msg, function(err,item) {
if (err) {
node.error(err,msg);
}else {
node.done();
}
});
}
@ -164,6 +172,8 @@ module.exports = function(RED) {
coll.update(query, payload, options, function(err, item) {
if (err) {
node.error(err,msg);
}else {
node.done();
}
});
}
@ -171,6 +181,8 @@ module.exports = function(RED) {
coll.remove(msg.payload, function(err, items) {
if (err) {
node.error(err,msg);
}else {
node.done();
}
});
}