modifying node-red-contrib-mongodb3

#1

i’m still new to node-red nodes and node-js so my question it may look easy to some of you.
i want to modify mongodb3 node, as we all know mongodb3 it takes any msg coming in json format in msg.payload and save it in mongo database.
so i want to add some attribute to the node itself and the node take those attribute and save them.
in other word i want to combine mongodb3 node with some attribute and i still want it to parse them as msg.payload and save them in the same node.

0 Likes

#2

So why not post a RFE (Request For Enhancement) for the node on it's github page?

0 Likes

#3

There’s a section on the node-red website about writing nodes which has some good comments about what makes a good node.

One thing we are beginning to see as the community grows is lots of very similar nodes that do one little thing slightly different. So we end up with very similar nodes all supported by one person, rather than a few nodes with a great team of contributors.

So it’s great you want to develop for Node-RED but could it be done as a contribution to an existing node? Or can you already do it with a “formatting” node before the mongodb node?

1 Like

#4

Thank you for replying,
i did it and any one can check it using npm i red-contrib-save-attribute .
so what the node do exactly is you can choose in it what's the attribute name that you want it to save their value, when they are passing throw the flow in json.
so you can test it by using inject node and put json data in it like name or age or email, and then at save attribute node add the name of the attribute that you want them to be saved automatically at your mongodb.
and that's will do the job.

0 Likes