<?php
$m = new MongoClient;
$c = $m->tutorial->beer;
// Create an index on the beer name attribute
$c->createIndex( [ 'beer_name' => 1 ] );
// Create a compound index on beer name and brewery name
$c->createIndex( [ 'beer_name' => 1, 'brewery_name' => 1 ] );
// Create a unique index on the name field of the venue attribute
$c->createIndex( [ 'venue.name' => 1 ] );
?>