I'm completely new to Mongo and RoR, coming from a PHP background.
I was just going through this tutorial about data modelling http://www.mongodb.org/display/DOCS/MongoDB+Data+Modeling+and+Rails
and was struck with the question of why the tutorial would recommend storing the votes in a field and updating that field as
db.stories.update({_id: story_id, voters: {'$ne': user_id}}, {'$inc': {votes: 1}, '$push': {voters: user_id}});instead of just
db.stories.update({_id: story_id, voters: {'$ne': user_id}}, {'$push': {voters: user_id}});
and then counting then
Story.voters.countto get the count of the number of users who have voted?
I know it's a tutorial, but it doesn't seem like the most efficient way to manage the data.