mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
parent
ea92f293e2
commit
4cfc7b39be
@ -83,7 +83,7 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("mongodb.status.connected")});
|
node.status({fill:"green",shape:"dot",text:RED._("mongodb.status.connected")});
|
||||||
node.clientDb = client.db();
|
node.client = client;
|
||||||
var db = client.db();
|
var db = client.db();
|
||||||
//console.log( db);
|
//console.log( db);
|
||||||
noerror = true;
|
noerror = true;
|
||||||
@ -185,7 +185,7 @@ module.exports = function(RED) {
|
|||||||
node.on("close", function() {
|
node.on("close", function() {
|
||||||
node.status({});
|
node.status({});
|
||||||
if (node.tout) { clearTimeout(node.tout); }
|
if (node.tout) { clearTimeout(node.tout); }
|
||||||
if (node.clientDb) { node.clientDb.close(); }
|
if (node.client) { node.client.close(); }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
RED.nodes.registerType("mongodb out",MongoOutNode);
|
RED.nodes.registerType("mongodb out",MongoOutNode);
|
||||||
@ -212,7 +212,7 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("mongodb.status.connected")});
|
node.status({fill:"green",shape:"dot",text:RED._("mongodb.status.connected")});
|
||||||
node.clientDb = client.db();
|
node.client = client;
|
||||||
var db = client.db();
|
var db = client.db();
|
||||||
noerror = true;
|
noerror = true;
|
||||||
var coll;
|
var coll;
|
||||||
@ -303,7 +303,7 @@ module.exports = function(RED) {
|
|||||||
node.on("close", function() {
|
node.on("close", function() {
|
||||||
node.status({});
|
node.status({});
|
||||||
if (node.tout) { clearTimeout(node.tout); }
|
if (node.tout) { clearTimeout(node.tout); }
|
||||||
if (node.clientDb) { node.clientDb.close(); }
|
if (node.client) { node.client.close(); }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
RED.nodes.registerType("mongodb in",MongoInNode);
|
RED.nodes.registerType("mongodb in",MongoInNode);
|
||||||
|
Loading…
Reference in New Issue
Block a user