title: $addToSet Based on Object key exists
body: <p>I have array <code>'pets': [{'fido': ['abc']}</code> that is a embeded document. When I add a pet to the array, how can I check to see if that pet already exists? For instance, if I added fido again... how can I check if only <code>fido</code> exists and not add it? I was hoping I could use <code>$addToSet</code> but I only want to check part of the set(the pets name). </p>
  
  <pre><code>User.prototype.updatePetArray = function(userId, petName) {
    userId = { _id: ObjectId(userId) };
    return this.collection.findOneAndUpdate(userId,
      { $addToSet: { pets: { [petName]: [] } } },
      { returnOriginal: false,
        maxTimeMS: QUERY_TIME });
  </code></pre>
  
  <p>Result of adding <code>fido</code> twice:</p>
  
  <pre><code>{u'lastErrorObject': {u'updatedExisting': True, u'n': 1}, u'ok': 1, u'value': {u'username': u'bob123', u'_id': u'56d5fc8381c9c28b3056f794', u'location': u'AT', u'pets': [{u'fido': []}]}}
  
  {u'lastErrorObject': {u'updatedExisting': True, u'n': 1}, u'ok': 1, u'value': {u'username': u'bob123', u'_id': u'56d5fc8381c9c28b3056f794', u'location': u'AT', u'pets': [{u'fido': [u'abc']}, {u'fido': []}]}}
  </code></pre>