<slide>
<title>Aggregation example</title>

<example result="3"><![CDATA[<?php
$m = new MongoClient();

$res = $m->demo->poiConcat->aggregate( [
    [ '$match' => [ 'ts' => new MongoRegex( '/^cuisine=/' ) ] ],
    [ '$unwind' => '$ts' ],
    /* Match again to get rid of all the useless ts */
    [ '$match' => [ 'ts' => new MongoRegex( '/^cuisine=/' ) ] ],
] );

var_dump( $res['result'] );
?>]]>
</example>
</slide>
