Giter Club home page Giter Club logo

node-red-mongo-storage-plugin's Introduction

Node Red Mongo Storage Plugin

This plugin allows you to store your flows and library entries in MongoDB.

The plugin creates a collection per entity type and save each entity seperatly which lead to increased performance.

Getting Started

For this one, you'll need a separate script to start your Node Red, as per the guide for running a custom Node-Red inside your process:

http://nodered.org/docs/embedding.html

You can also check my example node-red-app in the github repository: node red quickstart with node-red-mongo-storage-plugin

Firstly, require the module:

npm install --save node-red-mongo-storage-plugin

Then, in your settings, add:

var settings = {
	...
    storageModule : require("node-red-mongo-storage-plugin"),
    storageModuleOptions: {        
        mongoUrl: 'mongodb://localhost:27017',
        //also possible
        //mongoUrl: 'PROCESS.ENV.MONGOURL',
        database: 'local',
        //optional
        //set the collection name that the module would be using
        collectionNames:{
            flows: "nodered-flows",
            credentials: "nodered-credentials",
            settings: "nodered-settings",
            sessions: "nodered-sessions"
        }
    },
	...
};

Your storageModuleOptions could also be injected with env variables

credit to: freefoote for creating the npm package node-red-flows-mongo which help me made this one.

TODO

1.Add tests 2.Create an abstraction over mongoHandler for reusing with different types of databases.

node-red-mongo-storage-plugin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

node-red-mongo-storage-plugin's Issues

Migrating existing modules and flows to the MongoDB setup

Thanks for this plug-in! This is something what I was trying to find for a while!
I have been using the default Node-Red (file system based) storage and have a lot of contrib* node-red modules installed, as well as existing flows, sub-flows present.
How do I migrate these over if I am setting up the Mongo DB as my storage going forward?

Store settings

Hello @adibenmati ,

I'm testing your plugin and it seems to work fine with flows but doesn't seem to store settings properly. i.e: I made some change in Settings / View / Show grid: disabled but restarting application I see that option checked again.
Which kind of settings do you know can store?

node-red version: v1.0.6

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.