Skip to content

Commit 70f5d2e

Browse files
committed
Use extracts for repeated option notes
1 parent faf9f32 commit 70f5d2e

File tree

45 files changed

+157
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+157
-235
lines changed

docs/includes/extracts-common-option.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ content: |
1313
:manual:`currentOp </reference/command/currentOp>` output, and
1414
:manual:`logs </reference/log-messages>`.
1515
---
16+
ref: common-option-comment-string-before-4.4
17+
content: |
18+
The comment can be any valid BSON type since MongoDB 4.4. Earlier server
19+
versions only support string values.
20+
---
1621
ref: common-option-hint
1722
content: |
1823
The index to use. Specify either the index name as a string or the index key
@@ -41,6 +46,12 @@ content: |
4146
replacement:
4247
object: object
4348
---
49+
ref: common-option-readConcern-transaction
50+
content: |
51+
It is not possible to specify a read concern for individual operations as part
52+
of a transaction. Instead, set the ``readConcern`` option when
53+
:php:`starting the transaction <mongodb-driver-session.starttransaction>`.
54+
---
4455
ref: common-option-readPreference
4556
content: |
4657
:manual:`Read preference </reference/read-preference>` to use for the
@@ -66,4 +77,10 @@ content: |
6677
Defaults to the {{object}}'s write concern.
6778
replacement:
6879
object: object
80+
---
81+
ref: common-option-writeConcern-transaction
82+
content: |
83+
It is not possible to specify a write concern for individual operations as
84+
part of a transaction. Instead, set the ``writeConcern`` option when
85+
:php:`starting the transaction <mongodb-driver-session.starttransaction>`.
6986
...
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
ref: option-requires-4.2
3+
source:
4+
ref: option-requires-version
5+
file: extracts-option-requires.yaml
6+
replacement:
7+
version: "4.2"
8+
---
9+
ref: option-requires-4.4
10+
source:
11+
ref: option-requires-version
12+
file: extracts-option-requires.yaml
13+
replacement:
14+
version: "4.4"
15+
---
16+
ref: option-requires-5.0
17+
source:
18+
ref: option-requires-version
19+
file: extracts-option-requires.yaml
20+
replacement:
21+
version: "5.0"
22+
---
23+
ref: option-requires-5.3
24+
source:
25+
ref: option-requires-version
26+
file: extracts-option-requires.yaml
27+
replacement:
28+
version: "5.3"
29+
---
30+
ref: option-requires-6.0
31+
source:
32+
ref: option-requires-version
33+
file: extracts-option-requires.yaml
34+
replacement:
35+
version: "6.0"
36+
---
37+
ref: option-requires-7.0
38+
source:
39+
ref: option-requires-version
40+
file: extracts-option-requires.yaml
41+
replacement:
42+
version: "7.0"
43+
---
44+
ref: option-requires-version
45+
content: |
46+
This option is available since MongoDB {{version}} and will result in an
47+
exception at execution time if specified for an older server version.
48+
...

docs/reference/method/MongoDBClient-dropDatabase.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ Parameters
4242
- mixed
4343
- .. include:: /includes/extracts/common-option-comment.rst
4444

45-
This is not supported for server versions prior to 4.4 and will result
46-
in an exception at execution time if used.
45+
.. include:: /includes/extracts/option-requires-4.4.rst
4746

4847
.. versionadded:: 1.13
4948

docs/reference/method/MongoDBClient-listDatabaseNames.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ Parameters
5151
- mixed
5252
- .. include:: /includes/extracts/common-option-comment.rst
5353

54-
This is not supported for server versions prior to 4.4 and will result
55-
in an exception at execution time if used.
54+
.. include:: /includes/extracts/option-requires-4.4.rst
5655

5756
.. versionadded:: 1.13
5857

docs/reference/method/MongoDBClient-listDatabases.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ Parameters
4949
- mixed
5050
- .. include:: /includes/extracts/common-option-comment.rst
5151

52-
This is not supported for server versions prior to 4.4 and will result
53-
in an exception at execution time if used.
52+
.. include:: /includes/extracts/option-requires-4.4.rst
5453

5554
.. versionadded:: 1.13
5655

docs/reference/method/MongoDBClient-watch.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ Parameters
5656
- mixed
5757
- .. include:: /includes/extracts/common-option-comment.rst
5858

59-
The comment can be any valid BSON type for server versions 4.4 and above.
60-
Earlier server versions only support string values.
59+
.. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
6160

6261
.. versionadded:: 1.13
6362

docs/reference/method/MongoDBCollection-aggregate.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,7 @@ Parameters
110110
- :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>`
111111
- .. include:: /includes/extracts/collection-option-readConcern.rst
112112

113-
It is not possible to specify a :manual:`read concern
114-
</reference/read-concern>` for individual operations as part of a
115-
transaction. Instead, set the ``readConcern`` option when starting the
116-
transaction with :php:`startTransaction <mongodb-driver-session.starttransaction>`.
113+
.. include:: /includes/extracts/common-option-readConcern-transaction.rst
117114

118115
* - readPreference
119116
- :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`
@@ -133,10 +130,7 @@ Parameters
133130
- :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
134131
- .. include:: /includes/extracts/collection-option-writeConcern.rst
135132

136-
It is not possible to specify a :manual:`write concern
137-
</reference/write-concern>` for individual operations as part of a
138-
transaction. Instead, set the ``writeConcern`` option when starting the
139-
transaction with :php:`startTransaction <mongodb-driver-session.starttransaction>`.
133+
.. include:: /includes/extracts/common-option-writeConcern-transaction.rst
140134

141135
This only applies when a :ref:`$out <agg-out>` or
142136
:ref:`$merge <agg-merge>` stage is specified.

docs/reference/method/MongoDBCollection-bulkWrite.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ Parameters
7474
- mixed
7575
- .. include:: /includes/extracts/common-option-comment.rst
7676

77-
This is not supported for server versions prior to 4.4 and will result
78-
in an exception at execution time if used.
77+
.. include:: /includes/extracts/option-requires-4.4.rst
7978

8079
.. versionadded:: 1.13
8180

@@ -105,10 +104,7 @@ Parameters
105104
- :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
106105
- .. include:: /includes/extracts/collection-option-writeConcern.rst
107106

108-
It is not possible to specify a :manual:`write concern
109-
</reference/write-concern>` for individual operations as part of a
110-
transaction. Instead, set the ``writeConcern`` option when starting the
111-
transaction with :php:`startTransaction <mongodb-driver-session.starttransaction>`.
107+
.. include:: /includes/extracts/common-option-writeConcern-transaction.rst
112108

113109
Return Values
114110
-------------

docs/reference/method/MongoDBCollection-count.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ Parameters
5151
- mixed
5252
- .. include:: /includes/extracts/common-option-comment.rst
5353

54-
This is not supported for server versions prior to 4.4 and will result
55-
in an exception at execution time if used.
54+
.. include:: /includes/extracts/option-requires-4.4.rst
5655

5756
.. versionadded:: 1.13
5857

@@ -78,10 +77,7 @@ Parameters
7877
- :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>`
7978
- .. include:: /includes/extracts/collection-option-readConcern.rst
8079

81-
It is not possible to specify a :manual:`read concern
82-
</reference/read-concern>` for individual operations as part of a
83-
transaction. Instead, set the ``readConcern`` option when starting the
84-
transaction with :php:`startTransaction <mongodb-driver-session.starttransaction>`.
80+
.. include:: /includes/extracts/common-option-readConcern-transaction.rst
8581

8682
* - readPreference
8783
- :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`

docs/reference/method/MongoDBCollection-countDocuments.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ Parameters
4848
- mixed
4949
- .. include:: /includes/extracts/common-option-comment.rst
5050

51-
The comment can be any valid BSON type for server versions 4.4 and above.
52-
Earlier server versions only support string values.
51+
.. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
5352

5453
* - hint
5554
- string|array|object
@@ -67,10 +66,7 @@ Parameters
6766
- :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>`
6867
- .. include:: /includes/extracts/collection-option-readConcern.rst
6968

70-
It is not possible to specify a :manual:`read concern
71-
</reference/read-concern>` for individual operations as part of a
72-
transaction. Instead, set the ``readConcern`` option when starting the
73-
transaction with :php:`startTransaction <mongodb-driver-session.starttransaction>`.
69+
.. include:: /includes/extracts/common-option-readConcern-transaction.rst
7470

7571
* - readPreference
7672
- :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`

docs/reference/method/MongoDBCollection-createIndex.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ Parameters
9191
- mixed
9292
- .. include:: /includes/extracts/common-option-comment.rst
9393

94-
This is not supported for server versions prior to 4.4 and will result in an
95-
exception at execution time if used.
94+
.. include:: /includes/extracts/option-requires-4.4.rst
9695

9796
.. versionadded:: 1.13
9897

@@ -127,10 +126,7 @@ Parameters
127126
- :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
128127
- .. include:: /includes/extracts/collection-option-writeConcern.rst
129128

130-
It is not possible to specify a :manual:`write concern
131-
</reference/write-concern>` for individual operations as part of a
132-
transaction. Instead, set the ``writeConcern`` option when starting the
133-
transaction with :php:`startTransaction <mongodb-driver-session.starttransaction>`.
129+
.. include:: /includes/extracts/common-option-writeConcern-transaction.rst
134130

135131
Return Values
136132
-------------

docs/reference/method/MongoDBCollection-createIndexes.txt

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,22 @@ Parameters
5555
- mixed
5656
- .. include:: /includes/extracts/common-option-comment.rst
5757

58-
This is not supported for server versions prior to 4.4 and will result in an
59-
exception at execution time if used.
58+
.. include:: /includes/extracts/option-requires-4.4.rst
6059

6160
.. versionadded:: 1.13
6261

6362
* - commitQuorum
6463
- string|integer
6564
- Specifies how many data-bearing members of a replica set, including the
66-
primary, must complete the index builds successfully before the primary marks
67-
the indexes as ready.
65+
primary, must complete the index builds successfully before the primary
66+
marks the indexes as ready.
6867

69-
This option accepts the same values for the ``w`` field in a write concern
70-
plus ``"votingMembers"``, which indicates all voting data-bearing nodes.
68+
This option accepts the same values for the ``w`` field in a write
69+
concern plus ``"votingMembers"``, which indicates all voting
70+
data-bearing nodes.
7171

72-
This is not supported for server versions prior to 4.4 and will result in an
73-
exception at execution time if used.
72+
This is not supported for server versions prior to 4.4 and will result
73+
in an exception at execution time if used.
7474

7575
.. versionadded:: 1.7
7676

@@ -90,10 +90,7 @@ Parameters
9090
- :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
9191
- .. include:: /includes/extracts/collection-option-writeConcern.rst
9292

93-
It is not possible to specify a :manual:`write concern
94-
</reference/write-concern>` for individual operations as part of a
95-
transaction. Instead, set the ``writeConcern`` option when starting the
96-
transaction with :php:`startTransaction <mongodb-driver-session.starttransaction>`.
93+
.. include:: /includes/extracts/common-option-writeConcern-transaction.rst
9794

9895
Return Values
9996
-------------

docs/reference/method/MongoDBCollection-deleteMany.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,15 @@ Parameters
4949
- mixed
5050
- .. include:: /includes/extracts/common-option-comment.rst
5151

52-
This is not supported for server versions prior to 4.4 and will result
53-
in an exception at execution time if used.
52+
.. include:: /includes/extracts/option-requires-4.4.rst
5453

5554
.. versionadded:: 1.13
5655

5756
* - hint
5857
- string|array|object
5958
- .. include:: /includes/extracts/common-option-hint.rst
6059

61-
This option is available in MongoDB 4.4+ and will result in an
62-
exception at execution time if specified for an older server version.
60+
.. include:: /includes/extracts/option-requires-4.4.rst
6361

6462
.. versionadded:: 1.7
6563

@@ -79,10 +77,7 @@ Parameters
7977
- :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
8078
- .. include:: /includes/extracts/collection-option-writeConcern.rst
8179

82-
It is not possible to specify a :manual:`write concern
83-
</reference/write-concern>` for individual operations as part of a
84-
transaction. Instead, set the ``writeConcern`` option when starting the
85-
transaction with :php:`startTransaction <mongodb-driver-session.starttransaction>`.
80+
.. include:: /includes/extracts/common-option-writeConcern-transaction.rst
8681

8782
Return Values
8883
-------------

docs/reference/method/MongoDBCollection-deleteOne.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,15 @@ Parameters
5151
- mixed
5252
- .. include:: /includes/extracts/common-option-comment.rst
5353

54-
This is not supported for server versions prior to 4.4 and will result in an
55-
exception at execution time if used.
54+
.. include:: /includes/extracts/option-requires-4.4.rst
5655

5756
.. versionadded:: 1.13
5857

5958
* - hint
6059
- string|array|object
6160
- .. include:: /includes/extracts/common-option-hint.rst
6261

63-
This option is available in MongoDB 4.4+ and will result in an exception at
64-
execution time if specified for an older server version.
62+
.. include:: /includes/extracts/option-requires-4.4.rst
6563

6664
.. versionadded:: 1.7
6765

@@ -81,10 +79,7 @@ Parameters
8179
- :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
8280
- .. include:: /includes/extracts/collection-option-writeConcern.rst
8381

84-
It is not possible to specify a :manual:`write concern
85-
</reference/write-concern>` for individual operations as part of a
86-
transaction. Instead, set the ``writeConcern`` option when starting the
87-
transaction with :php:`startTransaction <mongodb-driver-session.starttransaction>`.
82+
.. include:: /includes/extracts/common-option-writeConcern-transaction.rst
8883

8984
Return Values
9085
-------------

docs/reference/method/MongoDBCollection-distinct.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ Parameters
5454
- mixed
5555
- .. include:: /includes/extracts/common-option-comment.rst
5656

57-
This is not supported for server versions prior to 4.4 and will result in an
58-
exception at execution time if used.
57+
.. include:: /includes/extracts/option-requires-4.4.rst
5958

6059
.. versionadded:: 1.13
6160

@@ -67,10 +66,7 @@ Parameters
6766
- :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>`
6867
- .. include:: /includes/extracts/collection-option-readConcern.rst
6968

70-
It is not possible to specify a :manual:`read concern
71-
</reference/read-concern>` for individual operations as part of a
72-
transaction. Instead, set the ``readConcern`` option when starting the
73-
transaction with :php:`startTransaction <mongodb-driver-session.starttransaction>`.
69+
.. include:: /includes/extracts/common-option-readConcern-transaction.rst
7470

7571
* - readPreference
7672
- :php:`MongoDB\\Driver\\ReadPreference <class.mongodb-driver-readpreference>`

docs/reference/method/MongoDBCollection-drop.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ Parameters
3939
- mixed
4040
- .. include:: /includes/extracts/common-option-comment.rst
4141

42-
This is not supported for server versions prior to 4.4 and will result in an
43-
exception at execution time if used.
42+
.. include:: /includes/extracts/option-requires-4.4.rst
4443

4544
.. versionadded:: 1.13
4645

@@ -80,10 +79,7 @@ Parameters
8079
- :php:`MongoDB\\Driver\\WriteConcern <class.mongodb-driver-writeconcern>`
8180
- .. include:: /includes/extracts/collection-option-writeConcern.rst
8281

83-
It is not possible to specify a :manual:`write concern
84-
</reference/write-concern>` for individual operations as part of a
85-
transaction. Instead, set the ``writeConcern`` option when starting the
86-
transaction with :php:`startTransaction <mongodb-driver-session.starttransaction>`.
82+
.. include:: /includes/extracts/common-option-writeConcern-transaction.rst
8783

8884

8985

0 commit comments

Comments
 (0)