PHP - Manual: MongoDB\BSON\Javascript::getCode
2024-11-14
(mongodb >=1.2.0)
MongoDB\BSON\Javascript::getCode — Returns the Javascript's code
此函数没有参数。
Returns the Javascript's code.
示例 #1 MongoDB\BSON\Javascript::getCode() example
<?php
$js = new MongoDB\BSON\Javascript('function foo(bar) { return bar; }');
var_dump($js->getCode());
?>
以上例程会输出:
string(33) "function foo(bar) { return bar; }"
官方地址:https://www.php.net/manual/en/mongodb-bson-javascript.getcode.php