mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #491 from anna2130/mongo-msg-collection
Fixes collection only being set by first message
This commit is contained in:
@@ -72,7 +72,7 @@ module.exports = function(RED) {
|
|||||||
coll = db.collection(node.collection);
|
coll = db.collection(node.collection);
|
||||||
}
|
}
|
||||||
node.on("input",function(msg) {
|
node.on("input",function(msg) {
|
||||||
if (!coll) {
|
if (!node.collection) {
|
||||||
if (msg.collection) {
|
if (msg.collection) {
|
||||||
coll = db.collection(msg.collection);
|
coll = db.collection(msg.collection);
|
||||||
} else {
|
} else {
|
||||||
@@ -173,7 +173,7 @@ module.exports = function(RED) {
|
|||||||
coll = db.collection(node.collection);
|
coll = db.collection(node.collection);
|
||||||
}
|
}
|
||||||
node.on("input", function(msg) {
|
node.on("input", function(msg) {
|
||||||
if (!coll) {
|
if (!node.collection) {
|
||||||
if (msg.collection) {
|
if (msg.collection) {
|
||||||
coll = db.collection(msg.collection);
|
coll = db.collection(msg.collection);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user