title: MongoDB like(upvote) and dislike(downvote) schema design
body: <p>I was <a href="https://stackoverflow.com/questions/25421164/insert-if-not-exists-else-remove-mongodb">going through this question and answer</a> then I saw the code below:    </p>
  
  <pre><code>{
      "_id": ObjectId("53f51a844ffa9b02cf01c074"),
      "upvoted": [],
      "downvoted": [],
      "upvoteCount": 0,
      "downvoteCount": 0
  }
  </code></pre>
  
  <p>I have somewhat a similar schema without the vote counts. Like you can see below.</p>
  
  <pre><code>{
      "_id": ObjectId("53f51a844ffa9b02cf01c074"),
      "upvoted": [],
      "downvoted": [],
  }
  </code></pre>
  
  <p>What is the advantage of having the count fields? Why not <a href="https://stackoverflow.com/questions/28253590/how-to-find-length-of-embedded-nested-array-in-mongodb">get the length of the embedded array</a> when you need to get the vote count? Does it help in performance(when you only want to query a voteCount)?</p>