Hi,
As far as I know Node Red editor saves the current flow(the flow you see when you open the editor) in flows.json file inside C/[username]/.node-red folder by default.
Can I force it to read and display the flow from MongoDB or a different file instead of flows.json when it started?
Alternatively, is there a way to get flows.json(the same json you get when you click export) with a node and send it as a msg.payload?
So if I understood correctly, when I add an entry (the flow i want to be displayed) to local mongo, that flow will be displayed when I started Node Red. Instead of the latest one I deployed, right?
I didn't understand what to do with the information in the first link. I'm currently running node red on base directory with "node red.js" command. Should I put the node-red-app provided in the same directory and run Node Red with the command "node node-red-app.js?" after setting up a local Mongo DB?
From what I understand I need to define my own red.js which I use to run Node Red Editor. I used the one provided in the github link above. And replaced Mongo-URL with my own DB's. Now, before running Node-RED it connects to my db but how do I save the flows file into and load from my MongoDB collection? It still uses the flows file in user directory.
You cannot use node-red to read your mongodb get all the flows and run it as such.
You could get specific flow(s) from mongo and using the node-red api to apply the flow.
I'm currently running node red on base directory with "node red.js"
Please don't.
Just use node-red, node-red [options] or node-red-start (depending how you installed it)
A storage plugin such as the mongo one, saves and loads flows directly from a different source. You might be saying the same thing but i read your statement as "it cannot be done"
For example, FlowForge uses this for saving all users flows from all the Node-RED instances into a SQLITE or PostgreSQL DB out of the box (depending on your choices)
I want multiple users to work on the same flow, while running different node-red instances simultaneously.
Currently I am running 2 Node-Red instances in different ports locally. When first started, both of them displays the flow I stored in MongoDB. Let's assume there is a flow in json format with 3 nodes in MongoDB. If I remove one of the nodes in instance A via the editor, MongoDB overwrites flows.json collection to have 2 nodes. But, when I refresh my page in instance B, there are still 3 nodes instead of 2. I want the changes I've made in instance A to be reflected on instance B.