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",
|
||||
"version" : "0.4.1",
|
||||
"version" : "0.4.2",
|
||||
"description" : "Node-RED nodes to talk to serial ports",
|
||||
"dependencies" : {
|
||||
"serialport" : "~4.0.3"
|
||||
"serialport" : "~4.0.7"
|
||||
},
|
||||
"repository" : {
|
||||
"type":"git",
|
||||
@ -12,7 +12,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"keywords": [ "node-red", "serial" ],
|
||||
"node-red": {
|
||||
"version": ">=0.13.0",
|
||||
"version": ">=0.14.0",
|
||||
"nodes": {
|
||||
"serialport": "25-serial.js"
|
||||
}
|
||||
|
@ -178,18 +178,19 @@ module.exports = function(RED) {
|
||||
node.clientDb = db;
|
||||
noerror = true;
|
||||
var coll;
|
||||
if (node.collection) {
|
||||
coll = db.collection(node.collection);
|
||||
}
|
||||
node.on("input", function(msg) {
|
||||
if (!node.collection) {
|
||||
if (msg.collection) {
|
||||
coll = db.collection(msg.collection);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
node.error(RED._("mongodb.errors.nocollection"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
coll = db.collection(node.collection);
|
||||
}
|
||||
var selector;
|
||||
if (node.operation === "find") {
|
||||
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) {
|
||||
if (err) {
|
||||
node.error(err);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
msg.payload = items;
|
||||
delete msg.projection;
|
||||
delete msg.sort;
|
||||
@ -220,12 +222,14 @@ module.exports = function(RED) {
|
||||
coll.count(selector, function(err, count) {
|
||||
if (err) {
|
||||
node.error(err);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
msg.payload = count;
|
||||
node.send(msg);
|
||||
}
|
||||
});
|
||||
} else if (node.operation === "aggregate") {
|
||||
}
|
||||
else if (node.operation === "aggregate") {
|
||||
msg.payload = (Array.isArray(msg.payload)) ? msg.payload : [];
|
||||
coll.aggregate(msg.payload, function(err, result) {
|
||||
if (err) {
|
||||
|
Loading…
Reference in New Issue
Block a user