Mongodb find() not working as expected, PHP
I got it working finally!

This is what I did.

$countries = $countries_tb-&gt;find(array('name.common' =&gt;   array('$regex' =&gt;  'Burk') ) );


Notice the . in name.common

Here is my foreach loop'

foreach( $countries as $country =&gt; $name) { 

   foreach ($name as $n){

       if(isset($n-&gt;common)){

            var_dump($n-&gt;common);

        }

   }
}

//It prints out:    country_cities.php:90:string 'Burkina Faso' (length=12)




Somehow, this does NOT work

$countries = $countries_tb-&gt;find(
                         array('name'=&gt;
                                 array('common' =&gt;   
                                         array('$regex' =&gt;   'Burk')) ) );


This is the JSON'

{"_id":"55a0f42f20a4d760b5fc306d","altSpellings":["BF"],"area":272967,"borders":["BEN","CIV","GHA","MLI","NER","TGO"],"callingCode":["226"],"capital":"Ouagadougou","cca2":"BF","cca3":"BFA","ccn3":"854","cioc":"BUR","currency":["XOF"],"demonym":"Burkinabe","landlocked":true,"languages":{"fra":"French"},"latlng":[13,-2],"name":{"common":"Burkina Faso","native":{"fra":{"common":"Burkina Faso","official":"Burkina Faso"}},"official":"Burkina Faso"},"region":"Africa","subregion":"Western Africa","tld":[".bf"],"translations":{"cym":{"common":"Burkina Faso","official":"Burkina Faso"},"deu":{"common":"Burkina Faso","official":"Burkina Faso"},"fin":{"common":"Burkina Faso","official":"Burkina Faso"},"fra":{"common":"Burkina Faso","official":"Burkina Faso"},"hrv":{"common":"Burkina Faso","official":"Burkina Faso"},"ita":{"common":"Burkina Faso","official":"Burkina Faso"},"jpn":{"common":"ブルキナファソ","official":"ブルキナファソ"},"nld":{"common":"Burkina Faso","official":"Burkina Faso"},"por":{"common":"Burkina Faso","official":"Burkina Faso"},"rus":{"common":"Буркина-Фасо","official":"Буркина -Фасо"},"spa":{"common":"Burkina Faso","official":"Burkina Faso"}}}