@@ -21,8 +21,8 @@ By default, the |php-library| returns BSON documents as
21
21
:phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as
22
22
:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively.
23
23
24
- BSON Classes
25
- ------------
24
+ Classes
25
+ -------
26
26
27
27
.. phpclass:: MongoDB\\Model\\BSONArray
28
28
@@ -49,40 +49,3 @@ BSON Classes
49
49
class. During BSON and JSON serialization, instances of this class will
50
50
serialize as a document type (:php:`object casting
51
51
<types.type-juggling#language.types.typecasting>` is used internally).
52
-
53
- .. _php-type-map:
54
-
55
- Type Maps
56
- ---------
57
-
58
- Most methods that read data from MongoDB support a ``typeMap`` option, which
59
- allows control over how BSON is converted to PHP. Additionally,
60
- the :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
61
- :phpclass:`MongoDB\\Collection` classes accept a ``typeMap`` option, which can
62
- be used to specify a default type map to apply to any supporting methods and
63
- selected classes (e.g. :phpmethod:`MongoDB\\Client::selectDatabase()`).
64
-
65
- The :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
66
- :phpclass:`MongoDB\\Collection` classes use the following type map by
67
- default:
68
-
69
- .. code-block:: php
70
-
71
- [
72
- 'array' => 'MongoDB\Model\BSONArray',
73
- 'document' => 'MongoDB\Model\BSONDocument',
74
- 'root' => 'MongoDB\Model\BSONDocument',
75
- ]
76
-
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
0 commit comments