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

Fixed check for array in MongoDB aggregate function

Fixes #525
This commit is contained in:
Anna Thomas 2015-01-05 10:57:49 +00:00
parent 9e4187d6a8
commit ed6272ce12

View File

@ -206,7 +206,7 @@ module.exports = function(RED) {
} }
}); });
} else if (node.operation === "aggregate") { } else if (node.operation === "aggregate") {
msg.payload = (msg.payload instanceof Array) ? msg.payload : []; msg.payload = (Array.isArray(msg.payload)) ? msg.payload : [];
coll.aggregate(msg.payload, function(err, result) { coll.aggregate(msg.payload, function(err, result) {
if (err) { if (err) {
node.error(err); node.error(err);