Question: I have an object and within that object, I have an array of objects. I'm trying to remove a single object from within the array. My code right now removes the entire object and I'm not sure why. Any thoughts?

eg: `Collection example`

```
"profiles": {
  "names": [
    {
      "first": "Joe",
      "last": "First",
      "uniqueId": "075ae7fda11"
    },
    {
      "first": "Sam",
      "last": "Last",
      "uniqueId": "1488096533"
    }
  ]
}

```

eg. `Update method`

```
MyCollection.update({_id: userId}, {
  $unset: {
    profiles: {
      'names.$.first': 'Joe'
    }
  }
});

```

Answer: 
This is how you can do it,

```
MyCollection.update({ _id: userId) },
    {
        "$pull":
            {
                "profiles.names":
                    {
                        "first": "Joe"
                    }
            }
    });

```
$pull removes an element from an array.

$unset removes the whole array (or any other field).