Just to be careful with the strict comparison. Object inequalities holds.
<?php
$m1 = new MongoId('51b14c2de8e185801f000006');
$m2 = new MongoId('51b14c2de8e185801f000006');
var_dump($m1 === $m2); //gives you boolean false
var_dump($m1 == $m2); //gives you boolean true
$m3 = new MongoId('51b14c2de8e185801f000006');
$m4 = new MongoId('51b14c2de8e185801f000007');
var_dump($m3 === $m4); //gives you boolean false
var_dump($m3 == $m4); //gives you boolean false
?>