I have this object in my db.
Array(
[_id] => MongoId Object
(
[$id] => 4fcdb3b8749d786c03000002
)
[email] => foo@bar.com
[folder] => Array
(
[root] => Array
(
[feeds] => Array
(
[0] => Array
(
[feedID] => MongoId Object
(
[$id] => 4fcdaa9e749d786c03000001
)
[title] => title.com
)
)
[title] => root
)
)
[status] => 1
[username] => foouser)
I want pull just item [0] from [feeds]. I use this code but it not working:
$usersCollection->update(array("username" => "foouser"), array('$pull'=> array('folder'=>array('root'=>array('feeds'=>array('feedID'=>$id))))));
When I use this $unset instead of $pull, full of [folder] will be gone.