GoLang MongoCode::__toString

request it (327)
GoLang replacement for PHP's MongoCode::__toString [edit | history]



Do you know a GoLang replacement for PHP's MongoCode::__toString? Write it!

PHP MongoCode::__toString

PHP original manual for MongoCode::__toString [ show | php.net ]

MongoCode::__toString

(PECL mongo >= 0.8.3)

MongoCode::__toStringReturns this code as a string

Description

public string MongoCode::__toString ( void )

Parameters

This function has no parameters.

Return Values

This code, the scope is not returned.

Examples

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

?>

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}); } }