MongoDB\BSON\Document::fromJSON
(mongodb >=1.16.0)
MongoDB\BSON\Document::fromJSON — Construct a new document instance from a JSON string
说明
Converts an » extended JSON string to its BSON representation.
参数
json(string)- 
     
JSON value to be converted.
 
返回值
Returns a new MongoDB\BSON\Document instance.
错误/异常
- Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors.
 - Throws MongoDB\Driver\Exception\UnexpectedValueException if the JSON value cannot be converted to a BSON document (e.g. due to a syntax error).
 
参见
- MongoDB\BSON\Document::fromPHP() - Construct a new document instance from PHP data
 - MongoDB\BSON\Document::fromBSON() - Construct a new document instance from a BSON string
 - » MongoDB Extended JSON
 - » BSON Types
 
  +添加备注
  
 用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/mongodb-bson-document.fromjson.php