title: E11000 : MongoDB how do I get rid of this error
body: <pre><code>MongoError: E11000 duplicate key error collection: 
  </code></pre>
  <p>So I understand why I am getting this error, but our system requires the index of the users UUID.</p>
  <p>So is there away to either a) solve this so it is coded correctly that it does not throw this error.</p>
  <p>B) disable this message - it's not useful.</p>
  <p>query causing it:</p>
  <pre><code> const userData = {&quot;UUID&quot;: uuid, &quot;ipaddress&quot;:ip};
     
    
          var update = {'$push':{
            &quot;history.$.endtime&quot;:Date.now()
          }};
        
  
          Listeners.findOneAndUpdate(
            {&quot;UUID&quot;: uuid, &quot;ipaddress&quot;:ip, &quot;history.HID&quot;:hid},
            { $set: { &quot;history.$.endtime&quot;:Date.now() } }, function(err) {
            if (err) {
                console.log('ERROR when submitting round');
                console.log(err);
            }
        });
  </code></pre>