PHP Conference Japan 2024

MongoDB\BSON\Javascript::getCode

(mongodb >=1.2.0)

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

Description

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

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

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top