custom query
accateo opened this issue · 1 comments
Hi,
i'm using your component "mongodb2" and "mongodb3". I'm having a problem to write this query:
db.collection.aggregate([{$match:{"id": {$eq: xxxxxx}}}, {"$group" : {_id:"$xxxxx", count:{$sum:1}}} ])
that works correctly in a mongo shell. But in your component there are only "aggregate.forEach" and "aggregate.toArray", but not only "aggregate". How can I resolve? Is there a possibility to put my query as string, directly?
Thanks
The aggregate function returns an AggregationCursor which i didn't think would be useful directly in node-red - especially due to the nature of node-red that may clone objects when they are sent as messages.
You would typically want to convert the AggregationCursor to an array of results or to iterate the results (i.e. use forEach
to send a new message per result).