(PECL mongo >= 0.8.3)
MongoCode::__toString — Returns this code as a string
此函数没有参数。
This code, the scope is not returned.
Example #1 MongoCode::__toString() example
<?php
$code = new MongoCode('return x;', array("x"=>"hi"));
echo "$code\n";
$code = new MongoCode('function() { for(i=0;i<10;i++) { db.foo.update({x:i}, {x:i+1}); } }');
echo "$code\n";
?>
以上例程的输出类似于:
return x; function() { for(i=0;i<10;i++) { db.foo.update({x:i}, {x:i+1}); } }