msg.topic = "SELECT home FROM presence WHERE presenceid LIKE 1";
msg.payload = [msg.payload];
return msg;If you were using a function node this would be
var theBitYouWantIs = msg.payload[0].home
msg.topic = "SELECT home FROM presence WHERE presenceid LIKE ?";
var theBitYouWantIs = msg.payload[0].home
msg.payload = [theBitYouWantIs];
return msg;Function (define query) -> sql ->
Than I'm pretty sure you don't need your msg.payload in your initial function.
As you have it the query gets passed in msg.topic
Whatever is in msg.payload gets overwritten by the output of the sql node.
Getting your head around JavaScript objects and arrays takes a while but there are some good tutorials you can find with your favourite search engine of choice
I am much more a Python guy