Skip to content

Commit 35381c3

Browse files
authored
PHPLIB-1322: Document codec option for classes and operations (#1264)
The bucket-option-codec and collection-option-codec do not inherit common-option-codec since Snooty does not yet support "post" for appending to inherited content. * Note why Bucket's codec option is not passed to CollectionWrapper
1 parent 01d0840 commit 35381c3

25 files changed

+161
-0
lines changed

docs/includes/extracts-bucket-option.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
ref: bucket-option-codec
2+
content: |
3+
The :doc:`codec </tutorial/codecs>` to use for encoding or decoding documents.
4+
This option is mutually exclusive with the ``typeMap`` option.
5+
6+
Defaults to the bucket's codec. Inheritance for a default ``codec`` option
7+
takes precedence over that of the ``typeMap`` option.
8+
---
19
ref: bucket-option-readConcern
210
source:
311
ref: common-option-readConcern

docs/includes/extracts-collection-option.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
ref: collection-option-codec
2+
content: |
3+
The :doc:`codec </tutorial/codecs>` to use for encoding or decoding documents.
4+
This option is mutually exclusive with the ``typeMap`` option.
5+
6+
Defaults to the collection's codec. Inheritance for a default ``codec`` option
7+
takes precedence over that of the ``typeMap`` option.
8+
---
19
ref: collection-option-collation
210
source:
311
ref: common-option-collation

docs/includes/extracts-common-option.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
ref: common-option-codec
2+
content: |
3+
The :doc:`codec </tutorial/codecs>` to use for encoding or decoding documents.
4+
This option is mutually exclusive with the ``typeMap`` option.
5+
---
16
ref: common-option-collation
27
content: |
38
:manual:`Collation </reference/collation>` allows users to specify

docs/reference/method/MongoDBClient-selectCollection.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ Parameters
4545
- Type
4646
- Description
4747

48+
* - codec
49+
- MongoDB\\Codec\\DocumentCodec
50+
- The default :doc:`codec </tutorial/codecs>` to use for collection
51+
operations.
52+
53+
.. versionadded:: 1.17
54+
4855
* - readConcern
4956
- :php:`MongoDB\Driver\ReadConcern <class.mongodb-driver-readconcern>`
5057
- The default read concern to use for collection operations. Defaults to

docs/reference/method/MongoDBClient-watch.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ Parameters
4848
- integer
4949
- .. include:: /includes/extracts/watch-option-batchSize.rst
5050

51+
* - codec
52+
- MongoDB\\Codec\\DocumentCodec
53+
- .. include:: /includes/extracts/common-option-codec.rst
54+
55+
.. versionadded:: 1.17
56+
5157
* - collation
5258
- array|object
5359
- .. include:: /includes/extracts/common-option-collation.rst

docs/reference/method/MongoDBCollection-aggregate.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ Parameters
7070
This only applies when using the :ref:`$out <agg-out>` and
7171
:ref:`$out <agg-merge>` stages.
7272

73+
* - codec
74+
- MongoDB\\Codec\\DocumentCodec
75+
- .. include:: /includes/extracts/collection-option-codec.rst
76+
77+
.. versionadded:: 1.17
78+
7379
* - collation
7480
- array|object
7581
- .. include:: /includes/extracts/collection-option-collation.rst

docs/reference/method/MongoDBCollection-bulkWrite.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ Parameters
7070
- If ``true``, allows the write operation to circumvent document level
7171
validation. Defaults to ``false``.
7272

73+
* - codec
74+
- MongoDB\\Codec\\DocumentCodec
75+
- .. include:: /includes/extracts/collection-option-codec.rst
76+
77+
Bulk writes use the codec for ``insertOne`` and ``replaceOne``
78+
operations.
79+
80+
.. versionadded:: 1.17
81+
7382
* - comment
7483
- mixed
7584
- .. include:: /includes/extracts/common-option-comment.rst

docs/reference/method/MongoDBCollection-find.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ Parameters
6161
Unlike the previous wire protocol version, a batchSize of ``1`` for the
6262
:dbcommand:`find` command does not close the cursor.
6363

64+
* - codec
65+
- MongoDB\\Codec\\DocumentCodec
66+
- .. include:: /includes/extracts/collection-option-codec.rst
67+
68+
.. versionadded:: 1.17
69+
6470
* - collation
6571
- array|object
6672
- .. include:: /includes/extracts/collection-option-collation.rst

docs/reference/method/MongoDBCollection-findOne.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ Parameters
5252
the :program:`mongos` if some shards are unavailable instead of
5353
throwing an error.
5454

55+
* - codec
56+
- MongoDB\\Codec\\DocumentCodec
57+
- .. include:: /includes/extracts/collection-option-codec.rst
58+
59+
.. versionadded:: 1.17
60+
5561
* - collation
5662
- array|object
5763
- .. include:: /includes/extracts/collection-option-collation.rst

docs/reference/method/MongoDBCollection-findOneAndReplace.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ Parameters
5050
- If ``true``, allows the write operation to circumvent document level
5151
validation. Defaults to ``false``.
5252

53+
* - codec
54+
- MongoDB\\Codec\\DocumentCodec
55+
- .. include:: /includes/extracts/collection-option-codec.rst
56+
57+
.. versionadded:: 1.17
58+
5359
* - collation
5460
- array|object
5561
- .. include:: /includes/extracts/collection-option-collation.rst

0 commit comments

Comments
 (0)