SocketIO with mongoDB

Hi every one !
I am trying to acces data sent over socketIO from a database mongo2 node. The idea is to retrive the msg.payload after de mongo2 node and send it in a socketIO node. I tried to add a socketOut just after the mongo2 node and I added a socketIn with a full msg debug to see what happens but nothing happens. So I tried to just send data like the flow below but I see that I did not understand how does socketIO work without template...
Am I using the right node? Any suggestion will help :sweat_smile:

[{"id":"b79c7d76.564898","type":"socketio-in","z":"2d750ed.93b04f2","name":"","server":"a402a54e.b77628","rules":[],"x":380,"y":620,"wires":[["cd6dde02.21d698"]]},{"id":"37f672f7.fb2236","type":"socketio-out","z":"2d750ed.93b04f2","name":"","server":"a402a54e.b77628","x":840,"y":420,"wires":[]},{"id":"cd6dde02.21d698","type":"debug","z":"2d750ed.93b04f2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":620,"wires":[]},{"id":"33fe7877.886a8","type":"inject","z":"2d750ed.93b04f2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":270,"y":420,"wires":[["5d908e43.e62db8"]]},{"id":"5d908e43.e62db8","type":"change","z":"2d750ed.93b04f2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"test\":\"test\"}","tot":"json"},{"t":"set","p":"socketIOEmit","pt":"msg","to":"test","tot":"str"},{"t":"set","p":"socketIOEvent","pt":"msg","to":"broadcast","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":420,"wires":[["37f672f7.fb2236"]]},{"id":"a402a54e.b77628","type":"socketio-config","port":"80","sendClient":"true","path":"/socket.io","bindToNode":true}]

Hi ..
you dont need third party nodes to create a websocket connection as these are part of the Node-red core nodes.

image

An example of their use can be found here

If your end goal is to create a Webpage / Dashboard to show this data coming from your mongodb, then you can use the Node-Red Dashboard set of nodes or Uibuilder

Thanks for your answer, I ended up using those nodes :grin:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.