With this post i want to explain some of my experiences with Mongodb and php mongo driver.

  • searching a  collection of Mongodb with a word we can use the code like this
$search = new MongoRegex(“/”.$str.”/i”);
$cursor = $collection->find(array(“Campo” => $search))
($str is the string for search,collection is the reference to db collection,Campo is the field to search)
(i will add more  later)
Advertisements