Socket
Book a DemoInstallSign in
Socket

node-red-contrib-mongodb-variable

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-mongodb-variable

MongoDB node for Node-RED

0.0.7
latest
Source
npmnpm
Version published
Weekly downloads
9
Maintainers
1
Weekly downloads
 
Created
Source

node-red-contrib-mongodb-variable

A Node-RED node to query MongoDB.

Edited by Andrii Lototskyi

Install

Run the following command in the root directory of your Node-RED install

npm install node-red-contrib-mongodb-variable

MongoDB node driver 3.1.13 interface for Node-RED based on node-red-bluemix-nodes and MongoDB 3 Driver Please refer to the mongoDB node driver 'Collection' documentation to read about each operation.

Set Credentials

add data to settings.js

mongoConnects:
{
   uri: "mongodb://login:password@host:27017/dbName"
},

Example For Request

set data in function node

msg.payload = {"login": "login"};
return msg;

Example node-red flowgit

Import the flow below in an empty sheet in nodered

[{"id":"f40a8af5.55fed8","type":"mongodb-var in","z":"1797a27a.5d0c6e","service":"_ext_","configNode":"49d0a8a1.8be078","name":"MongoDB","collection":"","operation":"find.toArray","x":464.5,"y":262,"wires":[["de8e6bf4.a24618"]]},{"id":"5c17003c.47d0d","type":"inject","z":"1797a27a.5d0c6e","name":"Start","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":143.5,"y":262,"wires":[["ced363e1.72367"]]},{"id":"ced363e1.72367","type":"function","z":"1797a27a.5d0c6e","name":"Request","func":"msg.payload = {};\nmsg.collection = 'collection_name';\nreturn msg;","outputs":1,"noerr":0,"x":294.5,"y":262,"wires":[["f40a8af5.55fed8"]]},{"id":"de8e6bf4.a24618","type":"debug","z":"1797a27a.5d0c6e","name":"Log Out","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":635.5,"y":262,"wires":[]},{"id":"49d0a8a1.8be078","type":"mongodb-var","z":"","uri":"mongodb://localhost:27017/dbName","name":"connect","options":"","parallelism":"-1"}]

Keywords

node-red

FAQs

Package last updated on 16 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.