Skip to content

Commit be623a4

Browse files
committed
PHPLIB-1322: Document codec option for classes and operations
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.
1 parent 01d0840 commit be623a4

24 files changed

+157
-1
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: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
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
2-
source:
10+
source:
311
ref: common-option-collation
412
file: extracts-common-option.yaml
513
post: |

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+
The codec will be utilized 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

docs/reference/method/MongoDBCollection-insertMany.txt

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

49+
* - codec
50+
- MongoDB\\Codec\\DocumentCodec
51+
- .. include:: /includes/extracts/collection-option-codec.rst
52+
53+
.. versionadded: 1.17
54+
4955
* - comment
5056
- mixed
5157
- .. include:: /includes/extracts/common-option-comment.rst

docs/reference/method/MongoDBCollection-insertOne.txt

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

49+
* - codec
50+
- MongoDB\\Codec\\DocumentCodec
51+
- .. include:: /includes/extracts/collection-option-codec.rst
52+
53+
.. versionadded: 1.17
54+
4955
* - comment
5056
- mixed
5157
- .. include:: /includes/extracts/common-option-comment.rst

docs/reference/method/MongoDBCollection-listSearchIndexes.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ Parameters
5252
returning a cursor or failure from ``aggregate`` without doing
5353
significant server-side work.
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/common-option-collation.rst

docs/reference/method/MongoDBCollection-replaceOne.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ Parameters
5252
- If ``true``, allows the write operation to circumvent document level
5353
validation. Defaults to ``false``.
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-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/collection-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-withOptions.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ Parameters
3535
- Type
3636
- Description
3737

38+
* - codec
39+
- MongoDB\\Codec\\DocumentCodec
40+
- The default :doc:`codec </tutorial/codecs>` to use for collection
41+
operations. Defaults to the original collection's codec.
42+
43+
.. versionadded: 1.17
44+
3845
* - readConcern
3946
- :php:`MongoDB\Driver\ReadConcern <class.mongodb-driver-readconcern>`
4047
- The default read concern to use for collection operations. Defaults to

docs/reference/method/MongoDBCollection__construct.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ Definition
4949
- Type
5050
- Description
5151

52+
* - codec
53+
- MongoDB\\Codec\\DocumentCodec
54+
- The default :doc:`codec </tutorial/codecs>` to use for collection
55+
operations.
56+
57+
.. versionadded: 1.17
58+
5259
* - readConcern
5360
- :php:`MongoDB\Driver\ReadConcern <class.mongodb-driver-readconcern>`
5461
- The default read concern to use for collection operations. Defaults to

docs/reference/method/MongoDBDatabase-aggregate.txt

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

77+
* - codec
78+
- MongoDB\\Codec\\DocumentCodec
79+
- .. include:: /includes/extracts/common-option-codec.rst
80+
81+
.. versionadded: 1.17
82+
7783
* - collation
7884
- array|object
7985
- .. include:: /includes/extracts/common-option-collation.rst

docs/reference/method/MongoDBDatabase-selectCollection.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ Parameters
4141
- Type
4242
- Description
4343

44+
* - codec
45+
- MongoDB\\Codec\\DocumentCodec
46+
- The default :doc:`codec </tutorial/codecs>` to use for collection
47+
operations.
48+
49+
.. versionadded: 1.17
50+
4451
* - readConcern
4552
- :php:`MongoDB\Driver\ReadConcern <class.mongodb-driver-readconcern>`
4653
- The default read concern to use for collection operations. Defaults to

docs/reference/method/MongoDBDatabase-selectGridFSBucket.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ Parameters
4444
- integer
4545
- The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
4646

47+
* - codec
48+
- MongoDB\\Codec\\DocumentCodec
49+
- The default :doc:`codec </tutorial/codecs>` to use for bucket methods
50+
that return a file document (e.g. :phpmethod:`MongoDB\GridFS\Bucket::find()`).
51+
52+
.. versionadded: 1.17
53+
4754
* - disableMD5
4855
- boolean
4956
- Whether to disable automatic MD5 generation when storing files.

docs/reference/method/MongoDBDatabase-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/MongoDBGridFSBucket-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/bucket-option-codec.rst
67+
68+
.. versionadded: 1.17
69+
6470
* - collation
6571
- array|object
6672
- .. include:: /includes/extracts/common-option-collation.rst

docs/reference/method/MongoDBGridFSBucket-findOne.txt

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

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

docs/reference/method/MongoDBGridFSBucket__construct.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ Parameters
5555
- integer
5656
- The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
5757

58+
* - codec
59+
- MongoDB\\Codec\\DocumentCodec
60+
- The default :doc:`codec </tutorial/codecs>` to use for bucket methods
61+
that return a file document (e.g. :phpmethod:`MongoDB\GridFS\Bucket::find()`).
62+
63+
.. versionadded: 1.17
64+
5865
* - disableMD5
5966
- boolean
6067
- Whether to disable automatic MD5 generation when storing files.

0 commit comments

Comments
 (0)