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:
		@@ -279,8 +279,16 @@ module.exports = function(RED) {
 | 
				
			|||||||
                                    node.error(err);
 | 
					                                    node.error(err);
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                                else {
 | 
					                                else {
 | 
				
			||||||
                                    msg.payload = result;
 | 
					                                     cursor.toArray(function(cursorError, cursorDocs) {
 | 
				
			||||||
                                    node.send(msg);
 | 
					                                       console.log(cursorDocs);
 | 
				
			||||||
 | 
					                                       if (cursorError) {
 | 
				
			||||||
 | 
					                                         node.error(cursorError);
 | 
				
			||||||
 | 
					                                       }
 | 
				
			||||||
 | 
					                                       else {
 | 
				
			||||||
 | 
					                                         msg.payload = cursorDocs;
 | 
				
			||||||
 | 
					                                         node.send(msg);
 | 
				
			||||||
 | 
					                                       }
 | 
				
			||||||
 | 
					                                     });
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            });
 | 
					                            });
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user