Monday 26 June 2017

MongoDB Native Driver - How to best notify client socket that a document has changed?

I'm developing a Microservice based application with Express, Socket.io and MongoDB native driver. We originally had Mongoose, so when we needed to push a new version of an object to the client, it was very easy with Mongoose - register the "post-" hook and send it.We had to get rid of Mongoose, because we had issues working with it in our specific use case, and we are triggering the notification in every service/model method manually now.I have looked at Meteor, its Mongo library is pretty much what we need, except it's tied to Meteor, so it probably won't work outside of it.Are there any better ways of solving this problem?

Submitted June 26, 2017 at 02:25PM by poom0nster

No comments:

Post a Comment