mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
mongodb - dereference aggregateCursor (#696)
new node.js client library moved aggregate response - using toArray to return result-set in msg.payload #693
This commit is contained in:
parent
aa45796a98
commit
4ae0818a4b
@ -279,7 +279,13 @@ module.exports = function(RED) {
|
|||||||
node.error(err);
|
node.error(err);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
msg.payload = result;
|
cursor.toArray(function(cursorError, cursorDocs) {
|
||||||
|
console.log(cursorDocs);
|
||||||
|
if (cursorError) {
|
||||||
|
node.error(cursorError);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msg.payload = cursorDocs;
|
||||||
node.send(msg);
|
node.send(msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -288,6 +294,8 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (node.mongoConfig) { connectToDB(); }
|
if (node.mongoConfig) { connectToDB(); }
|
||||||
else { node.error(RED._("mongodb.errors.missingconfig")); }
|
else { node.error(RED._("mongodb.errors.missingconfig")); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user