UNPKG

node-red-contrib-mongoql

Version:

MongoDB Query for Node-Red

43 lines (41 loc) 1.67 kB
<script type="text/html" data-template-name="findById"> <div class="form-row"> <label for="node-input-name">Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-tips"> To use this node, you need to provide <code>msg.url</code> (string), <code>msg.db_name</code> (string), <code>msg.db_collection</code> (string) and <code>msg.id</code> (string) on your function node or inject node. </div> </script> <script type="text/html" data-help-name="findById"> <p> <strong>About</strong><br/> This node implement find based on ObjectId() function from MongoDB Driver.<br/><br/> To use this node, you need to provide <code>msg.url</code> (string), <code>msg.db_name</code> (string), <code>msg.db_collection</code> (string) and <code>msg.id</code> (string) on your function node or inject node.<br/><br/> <strong>Example (Function Node)</strong><br/> msg.url = "mongodb://localhost:27017";<br/> msg.db_name = "pos";<br/> msg.db_collection = "product";<br/> msg.id = "610643574475991b81c2297e";<br/> return msg; </p> </script> <script type="text/javascript"> RED.nodes.registerType('findById', { category: 'MongoQL', color: '#68B368', defaults: { name: { value: "" } }, inputs: 1, outputs: 1, icon: "mongodb.png", paletteLabel: 'findById', align: 'left', label: function () { return this.name || "findById"; } }); </script>