title: nodejs mongodb findAndModify exception: E11000 duplicate key error index
body: <p>monogodb databse: </p>
  
  <pre><code> { "title" : "A vs B ha",
        "status" : 1,
        "items" : [ 
          { "name" : "0",
            "num" : 0,
            "men" : [ 
              { "user" : "id1",
                "score" : 300 }, 
              { "user" : "id2",
                "score" : 1300 }, 
              { "user" : "id3",
                "score" : 400 } ] }, 
          { "name" : "1",
            "num" : 0,
            "men" : [ 
              { "user" : "id11",
                "score" : 3300 }, 
              { "user" : "id23",
                "score" : 13400 }, 
              { "user" : "id3",
                "score" : 4000 } ] }, 
          { "name" : "2",
            "num" : 0,
            "men" : [] } ],
        "_id" : ObjectId( "538db59fa332f765c0f2c210" ) }
  </code></pre>
  
  <p>This Node.js code doesn't work:</p>
  
  <pre><code>collection.findAndModify(
  {"_id": idSearch
  ,"items.name":sBetItem,"items.men.user":sUser}
  ,[]
  , {
    $set:{
        "items.men.user":sUser}
    ,$inc: { "items.men.score": sScore }
  }
  , {new:true, upsert:true}
  
  ,function(err, docUser) {
    if (err){
        console.warn(err.message);  // returns error if no matching object found
    }else{
        console.dir(docUser);
    }
  
  });
  </code></pre>
  
  <p>I want to search a player's score, if it doesn't exist, insert new;
  if it already exist, increase his score number. 
  But it has error:exception: E11000 duplicate key error index </p>