<?php
$mongo = new MongoClient();
$db = $mongo->dbName;
$collection = $db->collectionName;
$cursor = $collection->find(
$criteria,
array('_id' => 1)
)->limit(1);
if($coursor->count() == 0){
exit('not exist');
}
exit('exits');