Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<MongoDB\BSON\Document::__constructMongoDB\BSON\Document::fromJSON>
^MongoDB\BSON\DocumentLast updated: Mon, 26 Oct 2026

MongoDB\BSON\Document::fromBSON

(mongodb >=1.16.0)

MongoDB\BSON\Document::fromBSON — Construct a new document instance from a BSON string

Description

final static public function MongoDB\BSON\Document::fromBSON(string $bson): MongoDB\BSON\Document

Parameters

bson (string)

A string containing a document in BSON format.

Return Values

Returns a new MongoDB\BSON\Document instance.

Errors/Exceptions

See Also


<MongoDB\BSON\Document::__constructMongoDB\BSON\Document::fromJSON>
^MongoDB\BSON\DocumentLast updated: Mon, 26 Oct 2026