mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
bump serial port package
This commit is contained in:
parent
83ea35d0dd
commit
dcd2ede2c4
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-serialport",
|
"name" : "node-red-node-serialport",
|
||||||
"version" : "0.4.1",
|
"version" : "0.4.2",
|
||||||
"description" : "Node-RED nodes to talk to serial ports",
|
"description" : "Node-RED nodes to talk to serial ports",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"serialport" : "~4.0.3"
|
"serialport" : "~4.0.7"
|
||||||
},
|
},
|
||||||
"repository" : {
|
"repository" : {
|
||||||
"type":"git",
|
"type":"git",
|
||||||
@ -12,7 +12,7 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"keywords": [ "node-red", "serial" ],
|
"keywords": [ "node-red", "serial" ],
|
||||||
"node-red": {
|
"node-red": {
|
||||||
"version": ">=0.13.0",
|
"version": ">=0.14.0",
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"serialport": "25-serial.js"
|
"serialport": "25-serial.js"
|
||||||
}
|
}
|
||||||
|
@ -178,18 +178,19 @@ module.exports = function(RED) {
|
|||||||
node.clientDb = db;
|
node.clientDb = db;
|
||||||
noerror = true;
|
noerror = true;
|
||||||
var coll;
|
var coll;
|
||||||
if (node.collection) {
|
|
||||||
coll = db.collection(node.collection);
|
|
||||||
}
|
|
||||||
node.on("input", function(msg) {
|
node.on("input", function(msg) {
|
||||||
if (!node.collection) {
|
if (!node.collection) {
|
||||||
if (msg.collection) {
|
if (msg.collection) {
|
||||||
coll = db.collection(msg.collection);
|
coll = db.collection(msg.collection);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
node.error(RED._("mongodb.errors.nocollection"));
|
node.error(RED._("mongodb.errors.nocollection"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
coll = db.collection(node.collection);
|
||||||
|
}
|
||||||
var selector;
|
var selector;
|
||||||
if (node.operation === "find") {
|
if (node.operation === "find") {
|
||||||
msg.projection = msg.projection || {};
|
msg.projection = msg.projection || {};
|
||||||
@ -206,7 +207,8 @@ module.exports = function(RED) {
|
|||||||
coll.find(selector,msg.projection).sort(msg.sort).limit(limit).skip(skip).toArray(function(err, items) {
|
coll.find(selector,msg.projection).sort(msg.sort).limit(limit).skip(skip).toArray(function(err, items) {
|
||||||
if (err) {
|
if (err) {
|
||||||
node.error(err);
|
node.error(err);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
msg.payload = items;
|
msg.payload = items;
|
||||||
delete msg.projection;
|
delete msg.projection;
|
||||||
delete msg.sort;
|
delete msg.sort;
|
||||||
@ -220,12 +222,14 @@ module.exports = function(RED) {
|
|||||||
coll.count(selector, function(err, count) {
|
coll.count(selector, function(err, count) {
|
||||||
if (err) {
|
if (err) {
|
||||||
node.error(err);
|
node.error(err);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
msg.payload = count;
|
msg.payload = count;
|
||||||
node.send(msg);
|
node.send(msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (node.operation === "aggregate") {
|
}
|
||||||
|
else if (node.operation === "aggregate") {
|
||||||
msg.payload = (Array.isArray(msg.payload)) ? msg.payload : [];
|
msg.payload = (Array.isArray(msg.payload)) ? msg.payload : [];
|
||||||
coll.aggregate(msg.payload, function(err, result) {
|
coll.aggregate(msg.payload, function(err, result) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user