MongoCode::__toString

(PECL mongo >= 0.8.3)
Returns this code as a string
public string MongoCode::__toString ( void )
Returns:

This code, the scope is not returned.

Examples:
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";

?>

The above example will output something similar to:

return x;
function() { for(i=0;i<10;i++) { db.foo.update({x:i}, {x:i+1}); } }
doc_php
2016-02-24 16:20:49
Comments
Leave a Comment

Please login to continue.