<slide>
<title>Document update modifiers: Array manipulation</title>

<list>
    <bullet>%*$push*%/%*$pushAll*% (adds elements to an array)</bullet>
    <bullet>%*$addToSet*% (like %$push%, but without duplicates in the array)</bullet>
    <bullet>%*$pop*% (removes the first or last element of an array)</bullet>
    <bullet>%*$pull*%/%*$pullAll*% (removes elements from an array)</bullet>
</list>

<example result="1"><![CDATA[<?php
$m = new MongoClient;
$c = $m->demo->circus; $c->remove();
$c->insert( [ '_id' => 'circ5', 'name' => 'Funny Led' ] );

$c->update(
    [ '_id' => 'circ5' ],
    [ '$push' => [ 'elephpants' => [ 'name' => 'Bobo', 'year' => 2012 ] ] ]
);
var_dump( $c->findOne( [ 'name' => 'Funny Led' ], [ 'elephpants' => 1 ] ) );
?>]]></example>
</slide>
