having this weird issue while inserting to MongoDB using PHP. My insertion code is as follows :
$tyre = array("m" => '5', "i" => 'test.png');
$tyreCollection->insert(array($tyre),array('safe'=>true));
After insertion, I see the following in my DB :
{'_id' : ObjectId("856876876786867"),"0":{"m":'5','i':'test.png'}}
Why does my new array have a key of 0 ? I am expecting :
{'_id' : ObjectId("856876876786867"),"m":'5','i':'test.png'}
What am I doing wrong ?