mongodb - Call stored procedure/function with PHP in Mongo DB sharded cluster -
mongodb - Call stored procedure/function with PHP in Mongo DB sharded cluster -
i using mongodb 2.6 2 shard clusters config. want phone call function datastats() create , store in mongodb. php script:
$client = new mongo(); $db = $client->mydata; $db->system->js->save(array("_id"=>"datastats", "value"=>new mongocode("function() { ... }"))); $db->execute("datastats()");
this code gives me error:
'err' => 'error: can\'t utilize sharded collection db.eval', 'code' => 16722
the reason $db->execute method using mongo db.eval command not supported sharded collections. there workaround issue? how can phone call stored procedure in sharded mongodb php?
there's no workaround. db.eval
doesn't work sharded collections. should avoid using if @ possible, anyway.
php mongodb sharding
Comments
Post a Comment