1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02: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:
Ross Cruickshank 2020-10-05 09:28:39 +01:00 committed by GitHub
parent aa45796a98
commit 4ae0818a4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,8 +279,16 @@ module.exports = function(RED) {
node.error(err);
}
else {
msg.payload = result;
node.send(msg);
cursor.toArray(function(cursorError, cursorDocs) {
console.log(cursorDocs);
if (cursorError) {
node.error(cursorError);
}
else {
msg.payload = cursorDocs;
node.send(msg);
}
});
}
});
}