HI !
I have problem with the spliting returning sql array result. As you will see down below i got the result from sql node normaly, but soon as pass through the split node i got that.
Here is the node, what i use:
[{"id":"8144efff.0ea0e","type":"inject","z":"11e1e4a1.276eeb","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":90,"y":540,"wires":[["57e4b127.669fa"]]},{"id":"13ab48eb.9794b7","type":"split","z":"11e1e4a1.276eeb","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":610,"y":620,"wires":[["f3f0b316.0f78c"]]},{"id":"f3f0b316.0f78c","type":"debug","z":"11e1e4a1.276eeb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":760,"wires":[]},{"id":"57e4b127.669fa","type":"function","z":"11e1e4a1.276eeb","name":"","func":"var sql=[]\n\nsql.push({topic : \" SELECT device_id FROM devices\"});\n/*sql.push({topic : \" SELECT humidity FROM tempandhum ORDER BY date DESC LIMIT 1\"});\nsql.push({topic : \"SELECT FROM_UNIXTIME(log_date,'%Y. %m. %d %H:%i:%s') As smoke_date FROM smoke_alert ORDER BY id DESC LIMIT 1\"});\nsql.push({topic : \"SELECT FROM_UNIXTIME(log_date,'%Y. %m. %d %H:%i:%s') As alert_date FROM alert ORDER BY id DESC LIMIT 1\"}); */\n\nreturn [sql];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":240,"y":600,"wires":[["39df1aa6.7158b6"]]},{"id":"39df1aa6.7158b6","type":"mysql","z":"11e1e4a1.276eeb","mydb":"d0b63b56.52c6c8","name":"","x":330,"y":660,"wires":[["480d9344.365e7c","13ab48eb.9794b7"]]},{"id":"480d9344.365e7c","type":"debug","z":"11e1e4a1.276eeb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":370,"y":740,"wires":[]},{"id":"d0b63b56.52c6c8","type":"MySQLdatabase","name":"","host":"127.0.0.1","port":"3306","db":"smh","tz":"","charset":"UTF8"}]
Can someone help me, how split the array result what i got correctly?
Thank you for your answers !