I want to clarify which approach shall I use to send the data from the client to the server. The jQuery post method or socket.emit?
My client side js
var userData = { location: markerLocation };
socket.emit('userData.save', userData, function (err, data) {
if (err) {
return app.alertError(err.message);
}
app.alertSuccess('[[map:details_save_success]]');
});
My plugin controller.js
Pl. help me write this piece of code: Shall I use socket.on or some other socketAPI? Also pl. guide me the right approach to overwrite the existing data (if any) for this particular req.uid in Mongo DB
Thanks in anticipation