mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Add i18n content for moved core nodes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2013,2015 IBM Corp.
|
||||
* Copyright 2013,2014 IBM Corp.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -76,7 +76,7 @@ module.exports = function(RED) {
|
||||
if (msg.collection) {
|
||||
coll = db.collection(msg.collection);
|
||||
} else {
|
||||
node.error("No collection defined",msg);
|
||||
node.error(RED._("mongodb.errors.nocollection"),msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -87,9 +87,6 @@ module.exports = function(RED) {
|
||||
if (typeof msg.payload !== "object") {
|
||||
msg.payload = {"payload": msg.payload};
|
||||
}
|
||||
if (msg.hasOwnProperty("_id") && !msg.payload.hasOwnProperty("_id")) {
|
||||
msg.payload._id = msg._id;
|
||||
}
|
||||
coll.save(msg.payload,function(err, item) {
|
||||
if (err) {
|
||||
node.error(err,msg);
|
||||
@@ -107,9 +104,6 @@ module.exports = function(RED) {
|
||||
if (typeof msg.payload !== "object") {
|
||||
msg.payload = {"payload": msg.payload};
|
||||
}
|
||||
if (msg.hasOwnProperty("_id") && !msg.payload.hasOwnProperty("_id")) {
|
||||
msg.payload._id = msg._id;
|
||||
}
|
||||
coll.insert(msg.payload, function(err, item) {
|
||||
if (err) {
|
||||
node.error(err,msg);
|
||||
@@ -149,7 +143,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.error("missing mongodb configuration");
|
||||
this.error(RED._("mongodb.errors.missingconfig"));
|
||||
}
|
||||
|
||||
this.on("close", function() {
|
||||
@@ -169,6 +163,7 @@ module.exports = function(RED) {
|
||||
|
||||
if (this.mongoConfig) {
|
||||
var node = this;
|
||||
var selector;
|
||||
MongoClient.connect(this.mongoConfig.url, function(err,db) {
|
||||
if (err) {
|
||||
node.error(err);
|
||||
@@ -183,11 +178,10 @@ module.exports = function(RED) {
|
||||
if (msg.collection) {
|
||||
coll = db.collection(msg.collection);
|
||||
} else {
|
||||
node.error("No collection defined");
|
||||
node.error(RED._("mongodb.errors.nocollection"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
var selector;
|
||||
if (node.operation === "find") {
|
||||
msg.projection = msg.projection || {};
|
||||
selector = ensureValidSelectorObject(msg.payload);
|
||||
@@ -237,7 +231,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.error("missing mongodb configuration");
|
||||
this.error(RED._("mongodb.errors.missingconfig"));
|
||||
}
|
||||
|
||||
this.on("close", function() {
|
||||
|
||||
Reference in New Issue
Block a user