mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
parent
246463752e
commit
fdfdbb17b7
@ -155,7 +155,16 @@ module.exports = function(RED) {
|
|||||||
msg.payload = JSON.parse(JSON.stringify(rows));
|
msg.payload = JSON.parse(JSON.stringify(rows));
|
||||||
}
|
}
|
||||||
else if (rows.constructor.name === "Array") {
|
else if (rows.constructor.name === "Array") {
|
||||||
msg.payload = rows.map(v => Object.assign({}, v));
|
if (rows[0] && rows[0].constructor.name === "RowDataPacket") {
|
||||||
|
msg.payload = rows.map(v => Object.assign({}, v));
|
||||||
|
}
|
||||||
|
else if (rows[0] && rows[0].constructor.name === "Array") {
|
||||||
|
if (rows[0][0] && rows[0][0].constructor.name === "RowDataPacket") {
|
||||||
|
msg.payload = rows.map(v => v.map(w => Object.assign({}, w)));
|
||||||
|
}
|
||||||
|
else { msg.payload = rows; }
|
||||||
|
}
|
||||||
|
else { msg.payload = rows; }
|
||||||
}
|
}
|
||||||
else { msg.payload = rows; }
|
else { msg.payload = rows; }
|
||||||
send(msg);
|
send(msg);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-mysql",
|
"name": "node-red-node-mysql",
|
||||||
"version": "0.1.7",
|
"version": "0.1.8",
|
||||||
"description": "A Node-RED node to read and write to a MySQL database",
|
"description": "A Node-RED node to read and write to a MySQL database",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mysql": "^2.18.1"
|
"mysql": "^2.18.1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user