mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Add updated mongodb functions
This commit is contained in:
@@ -128,6 +128,12 @@
|
||||
<option value="insert" data-i18n="mongodb.operation.insert"></option>
|
||||
<option value="update" data-i18n="mongodb.operation.update"></option>
|
||||
<option value="delete" data-i18n="mongodb.operation.remove"></option>
|
||||
<option value="insertOne" data-i18n="mongodb.operation.insertOne"></option>
|
||||
<option value="insertMany" data-i18n="mongodb.operation.insertMany"></option>
|
||||
<option value="updateOne" data-i18n="mongodb.operation.updateOne"></option>
|
||||
<option value="updateMany" data-i18n="mongodb.operation.updateMany"></option>
|
||||
<option value="deleteOne" data-i18n="mongodb.operation.deleteOne"></option>
|
||||
<option value="deleteMany" data-i18n="mongodb.operation.deleteMany"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-row node-input-payonly">
|
||||
@@ -154,15 +160,21 @@
|
||||
|
||||
<script type="text/html" data-help-name="mongodb out">
|
||||
<p>A simple MongoDB output node. Can save, insert, update and remove objects from a chosen collection.</p>
|
||||
<p>Save will update an existing object or insert a new object if one does not already exist.</p>
|
||||
<p>Insert will insert a new object.</p>
|
||||
<p>Save and insert either store <code>msg</code> or <code>msg.payload</code>.</p>
|
||||
<p>Save will update an existing object or insert a new object if one does not already exist. (deprecated)</p>
|
||||
<p>Insert will insert a new object. (deprecated)</p>
|
||||
<p>InsertOne will insert a new object.</p>
|
||||
<p>InsertMany will insert an array of new objects.</p>
|
||||
<p>Save, insert, and insertOne will either store <code>msg</code> or <code>msg.payload</code>.</p>
|
||||
<p>Update will modify an existing object or objects. The query to select objects to update uses <code>msg.query</code>
|
||||
and the update to the element uses <code>msg.payload</code>. If <code>msg.query._id</code> is
|
||||
a valid mongo ObjectId string it will be converted to an ObjectId type.</p>
|
||||
<p>Update can add a object if it does not exist or update multiple objects.</p>
|
||||
<p>Update can add a object if it does not exist or update multiple objects. (deprecated)</p>
|
||||
<p>UpdateOne will modify an existing object that matches the query. UpdateOne can add a object if it does not exist or update multiple objects.</p>
|
||||
<p>UpdateMany will modify all objects that match the query. UpdateOne can add a object if it does not exist or update multiple objects.</p>
|
||||
<p>Remove will remove objects that match the query passed in on <code>msg.payload</code>. A blank query will delete
|
||||
<i>all of the objects</i> in the collection.</p>
|
||||
<i>all of the objects</i> in the collection. (deprecated)</p>
|
||||
<p>DeleteOne will remove a single object that match the query passed in on <code>msg.payload</code>.</p>
|
||||
<p>DeleteMany will remove all objects that match the query passed in on <code>msg.payload</code>.</p>
|
||||
<p>You can either set the collection method in the node config or on <code>msg.collection</code>. Setting it in the
|
||||
node will override <code>msg.collection</code>.</p>
|
||||
<p>By default MongoDB creates an <i>_id</i> property as the primary key - so repeated injections of the
|
||||
@@ -178,10 +190,10 @@
|
||||
$("#node-input-operation").change(function () {
|
||||
var id = $("#node-input-operation option:selected").val();
|
||||
|
||||
if (id === "update") {
|
||||
if (id === "update" || id === "updateOne" || id === "updateMany") {
|
||||
$(".node-input-payonly").hide();
|
||||
$(".node-input-upsert, .node-input-multi").show();
|
||||
} else if (id === "delete") {
|
||||
} else if (id === "delete" || id === "deleteOne" || id === "deleteMany") {
|
||||
$(".node-input-payonly, .node-input-upsert, .node-input-multi").hide();
|
||||
} else {
|
||||
$(".node-input-payonly").show();
|
||||
|
Reference in New Issue
Block a user