MongoDB\BSON\Javascript
PHP Manual

MongoDB\BSON\Javascript::getCode

(mongodb >=1.2.0)

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

Description

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

Parameters

This function has no parameters.

Return Values

Returns the Javascript's code.

Errors/Exceptions

Examples

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

<?php

$js 
= new MongoDB\BSON\Javascript('function foo(bar) { return bar; }');
var_dump($js->getCode());

?>

The above example will output:

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

See Also


MongoDB\BSON\Javascript
PHP Manual