From 6ba0d8377878c67d1918ddff42636d71eedfa500 Mon Sep 17 00:00:00 2001 From: Anna Thomas Date: Mon, 17 Nov 2014 10:31:54 +0000 Subject: [PATCH] Fixes collection only being set by first message --- nodes/core/storage/66-mongodb.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodes/core/storage/66-mongodb.js b/nodes/core/storage/66-mongodb.js index 3a71407c6..86892580b 100644 --- a/nodes/core/storage/66-mongodb.js +++ b/nodes/core/storage/66-mongodb.js @@ -48,8 +48,8 @@ module.exports = function(RED) { } return selector; } - - + + function MongoOutNode(n) { RED.nodes.createNode(this,n); this.collection = n.collection; @@ -72,7 +72,7 @@ module.exports = function(RED) { coll = db.collection(node.collection); } node.on("input",function(msg) { - if (!coll) { + if (!node.collection) { if (msg.collection) { coll = db.collection(msg.collection); } else { @@ -173,7 +173,7 @@ module.exports = function(RED) { coll = db.collection(node.collection); } node.on("input", function(msg) { - if (!coll) { + if (!node.collection) { if (msg.collection) { coll = db.collection(msg.collection); } else {