doctrine/mongodb-odm — Issue #251: updating with the positional operator
Author: jvega
Created: 2012-02-09 20:58:38+00:00
State: open

how I should be implement an update query with $ positional operator?

this is the only way?

$conn = $dm->getConnection();
$collection = $conn->selectCollection('database', 'collection');
$output = $collection->update(
array('comments.author' => 'John'),
array('$set' => array('comments.$.author' => 'Jim'))
);

or exists something better? ...