Search code examples
jsonnode.jscouchdbcloudantnode-red

How can I read all documents in Cloudant and proess individual msg objects on NodeRED?


I'm reading a complete cloudant/apache couchdb database using the node-red cloudant connector and basically getting back a single big array of JSON objects (which I already don't like :) but anyway, what is the way (e.g. using a node-red javascript function) to transform this array into individual node-red messages?


Solution

  • You can use the split node for just this purpose.

    If the msg.payload it is passed contains an array, it emits a message for each element of that array.