1

For example:

$collection
->update(
    array(
        'Counter' => array('$gt' => 10)
    ),
    array(
        '$set' => array(
            'Value' => {'Counter'} * 1.05
        )
    ),
    array('multiple' => true)
);

Where {'Counter'} - is a counter field value from updated MongoDB document.

Need to update all Value = Counter * 1.05 where Counter > 10.

slava
  • 791
  • 1
  • 11
  • 26

0 Answers0