title: How to set array length after updating it via $addToSet in mongodb?
body: <p>Document structure looks like this,</p>
  
  <pre><code>{
      blacklists:[]         // elements should be unique
      blacklistsLength:0    // length of blacklists
  }
  </code></pre>
  
  <p>Adding sets of value to <code>blacklists</code> is easy.</p>
  
  <pre><code>db.posts.update({_id:...}, {$addtoSet:{blacklists:{$each:['peter', 'bob', 'steven']}}});
  </code></pre>
  
  <p>But How can I update <code>blacklistLength</code> at the same time to reflect the changes?</p>