MongoDB\BSON\Javascript::__toString

(mongodb >=1.2.0)

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

说明

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

此方法是该方法的别名: MongoDB\BSON\Javascript::getCode().

参数

此函数没有参数。

返回值

Returns the Javascript's code.

范例

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

<?php

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

?>

以上例程会输出:

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
关注编程学问公众号