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

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

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

$c->insert( [ '_id' => 'e42', 'name' => 'Kamubpo', 'age' => 17 ] );
$c->insert( [ '_id' => 'e43', 'name' => 'Denali', 'age' => 17 ] );

$c->update( [ 'age' => 17 ], [ '$inc' => [ 'age' => 1 ] ] );

var_dump( iterator_to_array( $c->find() ) );
?>]]></example>
</slide>
