mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
mysql, actually make the if else do something sensible...
This commit is contained in:
parent
a194c56acb
commit
c1c82a623e
@ -150,10 +150,10 @@ module.exports = function(RED) {
|
||||
node.error(err,msg);
|
||||
}
|
||||
else {
|
||||
if ((rows.constructor.name === "OkPacket") || (rows.constructor.name === "Array")) {
|
||||
if (rows.constructor.name === "OkPacket") {
|
||||
msg.payload = JSON.parse(JSON.stringify(rows));
|
||||
}
|
||||
else if ((rows.constructor.name === "OkPacket") || (rows.constructor.name === "Array")) {
|
||||
else if (rows.constructor.name === "Array") {
|
||||
msg.payload = rows.map(v => Object.assign({}, v));
|
||||
}
|
||||
else { msg.payload = rows; }
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red-node-mysql",
|
||||
"version": "0.1.5",
|
||||
"version": "0.1.6",
|
||||
"description": "A Node-RED node to read and write to a MySQL database",
|
||||
"dependencies": {
|
||||
"mysql": "^2.18.1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user