Mongodb aggregate data

how can i aggregate the data in node red?

  1. i am using node-red-contrib-mongodb2
[{"id":"a5d3fca9.1d6fb","type":"mongodb2 in","z":"17988aef.77ac65","service":"_ext_","configNode":"60e6b2b.5c7bc4c","name":"","collection":"cars","operation":"aggregate.toArray","x":670,"y":180,"wires":[["60a016a6.c089f8"]]},{"id":"60e6b2b.5c7bc4c","type":"mongodb2","z":"","uri":"mongodb://","name":"db","options":"","parallelism":"-1"}]
  1. i didnt understand how


Nodes to save and retrieve data in a local MongoDB instance.

Optionally, you may also (via a function) set

  • a msg.projection object to constrain the returned fields,
  • a msg.sort object,
  • a msg.limit number,
  • a msg.skip number.

You can either set the collection method in the node config or on msg.collection . Setting it in the node will override msg.collection .

this works ...

thanks if anyone can help~

Hi @apex,
I am kind of stuck in similar problem, did you find a solution to your problem ??

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.