how to insert inner array in mongodb using php I run this command in sheel then it runs
db.domain_data.update({"email":"rohan@walkover.in","url.tlds":".com"},{'$addToSet':{"url.$.domain":{"name":"rohan","status":"yes"}}}})
but I write this code in php then it not works
<?
$domain=array("name"=>"asvdsfs","status"=>"yes");
$condition=array("email"=>"rohan@walkover.in","url"=>array("tlds"=>".com"));
$arr=array('$addToSet'=>array("url.$.domain"=>array($domain)));
//$arr=array('$addToSet'=>array("url"=>array("$"=>array("domain"=>array($domain)))));
//Above line also not working.
$status=$db->domain_data->update($condition,array($arr));
?>
How to write above php code that it will run correct?
I think you probably have extra array