node.js - MEAN Stack socket.io pushing to client when existing data gets updated -


I am working on a MEAN; The Socket.io project where the Mongodb keeps my data in the back-end and I am using socket.io to publish new access data to all clients. To make it real time, I am using the Mongodb capped collection to send new arrival data (inclusive) to all customers using Socket.o emitted. However, I am struggling to find a way to send update data to the customer when the existing data is updated.

I know an alternative way, but for this I have to move my data from Mangodebi to a flat file. Create a clock for that file, but it is not an elegant solution

< P> If anyone has any better suggestion please share.

Why not, whenever there is an update, that view needs to be updated in the server .

  socket.emit ('updateData1', {_id: & lt; _idid of data) you are updating; Field 1: & lt; Price & gt; field2: & lt; Value & gt;})  

Just update _id and object in front-end (client).


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -