I'm attempting to remove references to a document (for the purpose of removing said document) using a $pull
update query however nothing appears to be happening.
I can manually run the following Mongo query
db.collection.update({}, {
$pull: {
'field': {'$id': ObjectId("xxxxxxxx")}
}
}, false, true)
which works fine. Attempting to do the same in Doctrine's ODM yields neither the expected result or any error messages. Here's what we have so far
$id = new MongoId("xxxxxxxx");
$qb = $repo->createQueryBuilder();
$qb->update();
$qb->field('field')->pull(array('$id' => $id));
$qb->getQuery()->execute();
Any hints about what I'm doing wrong?