How i can handle DB events with SockJS

guys! I have rest api application. That app work with MongoDB, write some model example. How i can send some massage to all connection on SockJs server when i save some data in db?

I was able to do this using redis. You may refer to this article for guide

http://www.oditorium.com/ou/2014/02/implementing-a-pubsub-model-using-redis-nodejs-sockjs/

The way to do it is to subscribe all sockjs connection to a redis channel so you will have to create a redis subscriber client on every sockjs connection created but make sure that you unsubscribe and close the client once the sockjs connection is disconnected.