Organizational Research By

Surprising Reserch Topic

voting system with backbone js

voting system with backbone js  using -'mongodb,backbone.js'

I have a Book model that has the property upVotes. Book instances can be queried from the database (MongoDB), modified, and then saved. If a user upvotes a book, I update the upVotes count, and save the whole model back to the server.

The problem is that if someone else votes between the time the instance is loaded, and the time the instance is saved, then the two votes will be saved as just one vote. What I need is an easy way to say "increment the model by 1 server-side", instead of "increment the model by 1 client-side and hope there will be no conflict".

asked Oct 13, 2015 by rajnipancholi
0 votes
1 view

Related Hot Questions

1 Answer

0 votes
answered Oct 13, 2015 by sumit_jaiswalmca