You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Node-RED
Good day,
a HTTP request gives me several arrays with objects.
How to split those objects from all arrays into single requests?
Thank you!
msg.payload : Object
object
firstResult: 0
maxResultHits: 50
hits: array[50]
[0 … 9]
0: object
1: object
2: object
3: object
4: object
5: object
6: object
7: object
8: object
9: object
[10 … 19]
[20 … 29]
[30 … 39]
[40 … 49]
totalHits: 574642
steve rickus
unread,
Nov 15, 2017, 10:09:55 AM11/15/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Node-RED
Have you tried using the split node? It can turn a msg.payload array into a stream of msg objects with each element in its own payload.
Since the split node expects the input msg to hold the array in msg.payload, wire in a change node before the split to "Set" msg.payload "to" msg.payload.hits
Seb
unread,
Nov 15, 2017, 10:18:18 AM11/15/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Node-RED
Amazing - thanks for the quick help!
Julian Knight
unread,
Nov 15, 2017, 12:33:16 PM11/15/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Node-RED
Just a note to say that the output you showed are not quite how they seem from the debug output. You only have 1 array of objects there, they are split only to keep the display performant. In actuality, that is a single array of objects.