Remove some excess console.log and tidy up some close calls

This commit is contained in:
Dave C-J
2013-10-15 21:12:30 +01:00
parent 4780c2bfe8
commit d8a6e28950
3 changed files with 21 additions and 29 deletions

View File

@@ -51,7 +51,6 @@ function MongoOutNode(n) {
else coll.save(msg,function(err,item){if (err){node.error(err);}});
}
if (node.operation == "delete") {
console.log(msg.payload);
coll.remove(msg.payload, {w:1}, function(err, items){ if (err) node.error(err); });
}
});
@@ -62,15 +61,15 @@ function MongoOutNode(n) {
} else {
this.error("missing mongodb configuration");
}
}
this.on("close", function() {
if (this.clientDb) {
this.clientDb.close();
}
});
}
RED.nodes.registerType("mongodb out",MongoOutNode);
MongoOutNode.prototype.close = function() {
if (this.clientDb) {
this.clientDb.close();
}
}
function MongoInNode(n) {
RED.nodes.createNode(this,n);
@@ -105,12 +104,11 @@ function MongoInNode(n) {
} else {
this.error("missing mongodb configuration");
}
}
this.on("close", function() {
if (this.clientDb) {
this.clientDb.close();
}
});
}
RED.nodes.registerType("mongodb in",MongoInNode);
MongoInNode.prototype.close = function() {
if (this.clientDb) {
this.clientDb.close();
}
}