<slide>
<title>Updating documents</title>

<blurb>Update only modifies the *first* document it finds by default.</blurb>

<blurb>You can set an option to modify *all* matched documents</blurb>

<example result="0"><![CDATA[<?php
$m = new MongoClient;
$c = $m->demo->products;
$c->drop();

$c->insert( [ '_id' => 'blue-elephpant',  'generation' => 1, 'price' => 7.5 ] );
$c->insert( [ '_id' => 'pink-elephpant',  'generation' => 2, 'price' => 8.0 ] );
$c->insert( [ '_id' => 'green-elephpant', 'generation' => 3, 'price' => 7.5 ] );

$c->update(
    [ 'generation' => [ '$lte' => 2 ] ],  // criteria
    [ '$inc' => [ 'price' => -2.0 ] ],    // update spec
    [ 'multiple' => true ]                // options: multiple
);
?>]]></example>
</slide>
