Repeats this for about 100x, and I know I have less than 20 MongoDB Nodes setup..
I even refined it to have MongoDB find, update, remove etc in their separate subflow, and just used that subflow instead of making multiply Mongo Node points. I would pass the msg.collection to this subflow. In theory I thought It would eliminate most mongo "instances" on this list, but I am seeing that it is not going away. There are still 100 or so, and seemingly not decreasing on changes.
Anyone know what's going on? I feel like there is many instances running, each eating up memory?
I am currently consolidating the DB's to a single node, and using them in a subflow...
I am using node-red-node-mongodb 0.2.5 flow to manage my the DB, which may be dated.
I also discovered there are some conflicts to some of the nodes?
Each of the subflow will have it's own connection to the database, subflows are just templates that are cloned for each instance of it on the canvas, they do not all share a single instance.
OK, so I continued to find all the MongoDB nodes in the flows, and now I have Isolated about 5 different MongoDB Nodes into their own subflow, Update, Save, Remove, Aggregate, Count ... So basically all my queries go through these subflows, instead of redundant MongoDB nodes all over the place. So I isolated these to subflows, and deleted all the redundant MongoDB nodes, and I am now glad to say that this now only reports a single line of connecting: mongodb://127.0.0.1:27017/psiaf2020 ...
I have 5 consolidated subflows now each with a different MongoDB operation. I use a function to set the msg.collection before passing to the MongoDB subflows, to target specific collections for those operations.
I can't seem to dynamically change the operation ie findcountaggregatesave ... But can pass in msg.collection and change that. So that leads to the 5 separate operations I'm using.
I was thinking that each of these (redundant?) MongoDB nodes used throughout the flows were creating each line / connection instance to the DB server. But when I cleaned them out via seek and destroy, They all whittled down to 1 line on the console report, despite having down to now 5 instances.
I can't seem to explain what happened there.
**CORRECTION: I was wrong, as I had the MongoDB nodes deleted at the time of checking, thinking I put them in there. ** So I have the 5 subflows with the MongoDB operators, and that long list is back when I restart Node-Red.