Hi,
I'm new to red node and stumbled upon a problem where my switch node using "contains" does not work as expected.
I have a device that sends a message like this:
{"action":"up_press","action_duration":null,"battery":77,"linkquality":174,"update":{"state":"idle"},"update_available":null}
I use a switch node with property: msg.payload and contains "up_", but that doesnt work. If I use property.payload.action, it works. I understand that action is nested within payload, but why does contains not do a recursive or full text search? I'd expect it to get the whole JSON object, and the object contains "up_".
So, two questions:
a) What is the conceptual reason why it is done this way, so I can learn more about node reds way of thinking.
b) how can I achieve a recursive or full body search with a switch node (in case I don't know exactly where the text will be)