<?php
$m = new MongoClient;
$c = $m->demo->circus; $c->remove();
$c->insert( [ '_id' => 'circ3', 'name' => 'Humberto', 'performers' => 12 ] );
$c->update(
[ 'name' => 'Humberto' ], // query
[ '$inc' => [ 'performers' => 4 ] ] // update spec
);
var_dump( $c->findOne( [ 'name' => 'Humberto' ] ) );
?>