GoLang MongoDB\BSON\Javascript::__toString

request it (400)
GoLang replacement for PHP's MongoDB\BSON\Javascript::__toString [edit | history]



Do you know a GoLang replacement for PHP's MongoDB\BSON\Javascript::__toString? Write it!

PHP MongoDB\BSON\Javascript::__toString

PHP original manual for MongoDB\BSON\Javascript::__toString [ show | php.net ]

MongoDB\BSON\Javascript::__toString

(mongodb >=1.2.0)

MongoDB\BSON\Javascript::__toStringReturns the Javascript's code

Description

final public string MongoDB\BSON\Javascript::__toString ( void )

This method is an alias of: MongoDB\BSON\Javascript::getCode().

Parameters

This function has no parameters.

Return Values

Returns the Javascript's code.

Errors/Exceptions

Examples

Example #1 MongoDB\BSON\Javascript::__toString() example

<?php

var_dump
((string) new MongoDB\BSON\Javascript('function foo(bar) { return bar; }'));

?>

The above example will output:

string(33) "function foo(bar) { return bar; }"

See Also