<slide>
<title>Exercise 1: Connecting and creating indexes</title>

<list>
    <bullet>%wget http://derickrethans.nl/files/dump/mongo-exercise1.php.txt%</bullet>
    <bullet>Open it in your favourite editor and edit.</bullet>
</list>
<example><![CDATA[<?php
$file = $argv[1];

// 1 ADD: Set variable $m to the connection, and $d to the collection "poi" in
// the database "demo" on localhost
$m = 
$d = 

// 2 ADD: Drop the collection
$d->

// 3 ADD: Create an index on "name" and a "2d" index on "loc"
$d->ensureIndex(
$d->ensureIndex(

var_dump($d->getIndexInfo());
]]></example>
<list>
    <bullet>Run the script!</bullet>
</list>
</slide>
