@@ -117,7 +117,24 @@ encoded will result in an exception. The ``aggregate``, ``find``, ``findOne``, `
117117``findOneAndReplace``, and ``findOneAndUpdate`` operations will attempt to decode returned documents using the provided
118118codec. If the codec does not support the data returned, an exception will be thrown. You can disable codec usage for a
119119specific operation or use a different codec (e.g. to decode the result of an aggregation pipeline) by specifying the
120- nullable ``codec`` option for the operation. This will override the collection-level codec.
120+ nullable ``codec`` option for the operation. This will override the collection-level codec:
121+ 122+ .. code-block:: php
123+ 124+ <?php
125+ 126+ // Returns a document using the default type map
127+ $collection->findOne(['name' => 'Jane Doe'], [
128+ 'codec' => null,
129+ ]);
130+ 131+ // Disables codec usage as the aggregate result will have a different format
132+ $collection->aggregate([['$group' => [
133+ '_id' => '$accountType',
134+ 'count' => ['$sum' => 1],
135+ ]]], [
136+ 'codec' => null,
137+ ]);
121138
122139Generic Codecs
123140--------------
0 commit comments