title: How to remove duplicate entries from an array?
body: <p>In the following example, <code>"Algorithms in C++"</code> is present twice.</p>
  
  <p>The <code>$unset</code> modifier can remove a particular field but how to remove an entry from a field?</p>
  
  <pre><code>{
    "_id" : ObjectId("4f6cd3c47156522f4f45b26f"), 
    "favorites" : {
      "books" : [
        "Algorithms in C++",    
        "The Art of Computer Programming", 
        "Graph Theory",      
        "Algorithms in C++"
      ]
    }, 
    "name" : "robert"
  }
  </code></pre>