MongoDB\BSON\Document::fromBSON
(mongodb >=1.16.0)
MongoDB\BSON\Document::fromBSON — Construct a new document instance from a BSON string
说明
参数
bson(string)-
A string containing a document in BSON format.
返回值
Returns a new MongoDB\BSON\Document instance.
错误/异常
- Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors.
- Throws MongoDB\Driver\Exception\UnexpectedValueException if
bsonis an invalid BSON string or contains more than a single document.
参见
- MongoDB\BSON\Document::fromPHP() - Construct a new document instance from PHP data
- MongoDB\BSON\Document::fromJSON() - Construct a new document instance from a JSON string
- » BSON Types