Deleting values from beep nested array by calling the ‘update’ function can be tricky to get right when using MongoDB. Suppose you have this structure:
{
  _id: 'someID',
  foo: [
    {
      bar: [
        {
          title: 't1'
        },
        {
          title: 't2'
        }
      ]
    },
    {
      bar: [
        {
          title: 't3'
        },
        {
          title: 't4'
        }
    }
  ]
}
Now suppose we want to remove the object with title ‘t1’ from the array it is in. I first tried doing this:
 db.myCollection.update({ _id : 'someID' },
                        { $pull : { 'foo.bar' : { 'title' : 't1' } } }); 
However, this did not seem to work. Adding a ‘.$’ after foo seemed to do the trick:
 db.myCollection.update({ _id : 'someID' },
                        { $pull : {'foo.$.bar' : { 'title' : 't1' } } });
I hope this saves you some time. Good luck!