MongoDB\BSON\Javascript::getCode

(mongodb >=1.2.0)

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

说明

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

参数

此函数没有参数。

返回值

Returns the Javascript's code.

错误/异常

范例

Example #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; }"
相关文章
php mongodb bson the mongodb bson javascript classphp mongodb bson dbpointer returns a representation that can be converted to jsonphp mongodb bson dbpointer returns an empty stringphp mongodb bson javascript construct a new javascriptphp mongodb bson javascript returns the javascript s codephp mongodb bson javascript returns the javascript s scope documentphp mongodb bson javascript returns a representation that can be converted to jsonphp mongodb bson javascript returns the javascript s codephp mongodb bson javascriptinterface returns the javascriptinterface s codephp mongodb bson javascriptinterface returns the javascriptinterface s codephp mongodb bson objectid returns the timestamp component of this objectidphp mongodb bson regexinterface returns the regexinterface s flagsphp mongodb bson regexinterface returns the regexinterface s patternphp mongodb bson regexinterface returns the string representation of this regexinterfacephp mongodb bson timestampinterface returns the increment component of this timestampinterfacephp mongodb bson timestampinterface returns the timestamp component of this timestampinterfacephp mongodb bson timestampinterface returns the string representation of this timestampinterfacephp mongodb bson utcdatetimeinterface returns the datetime representation of this utcdatetimeinterfacephp mongodb bson utcdatetimeinterface returns the string representation of this utcdatetimeinterfacephp mongodb driver writeconcern returns an object for bson serialization
关注编程学问公众号