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

Merge pull request #526 from anna2130/mongo-db-aggregate

Fixed check for array in MongoDB aggregate function
This commit is contained in:
Nick O'Leary 2015-01-05 11:14:18 +00:00
commit 65e4d83625

View File

@ -206,7 +206,7 @@ module.exports = function(RED) {
}
});
} 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) {
if (err) {
node.error(err);