Skip to content

Commit 994e331

Browse files
committed
Improve description of type map in BSON docs
1 parent da8a7fb commit 994e331

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/reference/bson.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ default:
7474
'root' => 'MongoDB\Model\BSONDocument',
7575
]
7676

77+
The type map above will convert BSON documents and arrays to
78+
:phpclass:`MongoDB\\Model\\BSONDocument` and
79+
:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The ``root`` and
80+
``document`` keys are used to distinguish the top-level BSON document from
81+
embedded documents, respectively.
82+
83+
A type map may specify any class that implements
84+
:php:`MongoDB\\BSON\\Unserializable <mongodb-bson-unserializable>` as well as
85+
``"array"``, ``"stdClass``", and ``"object"`` (``"stdClass``" and ``"object"``
86+
are aliases of one another).
87+
88+
.. seealso:: :php:`Deserialization from BSON <manual/en/mongodb.persistence.deserialization.php>` in the PHP manual
89+
7790
``Persistable`` Classes
7891
-----------------------
7992

0 commit comments

Comments
 (0)