Skip to content

Commit 103c1f2

Browse files
authored
PHPLIB-795, PHPLIB-796: Remove references to pre-3.6 servers (#893)
* Remove pre-3.6 server versions from Evergreen matrix * Remove references to unsupported pre-3.6 features in docs * Remove version checks for pre-3.6 servers Preserve behavior for only sending bypassDocumentValidation if true. This also removes a reference to an undeclared var in ModifyCollection (PHPLIB-796). * Remove skipped tests for pre-3.6 servers
1 parent b032a82 commit 103c1f2

File tree

99 files changed

+202
-1208
lines changed

Some content is hidden

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

99 files changed

+202
-1208
lines changed

.evergreen/config.yml

+2-14
Original file line numberDiff line numberDiff line change
@@ -575,18 +575,6 @@ axes:
575575
display_name: "3.6"
576576
variables:
577577
VERSION: "3.6"
578-
- id: "3.4"
579-
display_name: "3.4"
580-
variables:
581-
VERSION: "3.4"
582-
- id: "3.2"
583-
display_name: "3.2"
584-
variables:
585-
VERSION: "3.2"
586-
- id: "3.0"
587-
display_name: "3.0"
588-
variables:
589-
VERSION: "3.0"
590578

591579
- id: edge-versions
592580
display_name: MongoDB Version
@@ -596,9 +584,9 @@ axes:
596584
variables:
597585
VERSION: "5.0"
598586
- id: "oldest-supported"
599-
display_name: "3.0"
587+
display_name: "3.6"
600588
variables:
601-
VERSION: "3.0"
589+
VERSION: "3.6"
602590

603591
- id: driver-versions
604592
display_name: Driver Version

docs/includes/apiargs-MongoDBClient-common-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ type: :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>`
44
description: |
55
:manual:`Read concern </reference/read-concern>` to use for the operation.
66
Defaults to the client's read concern.
7-
8-
This is not supported for server versions prior to 3.2 and will result in an
9-
exception at execution time if used.
107
interface: phpmethod
118
operation: ~
129
optional: true

docs/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@ post: |
1313
source:
1414
file: apiargs-MongoDBClient-common-option.yaml
1515
ref: writeConcern
16-
post: |
17-
This is not supported for server versions prior to 3.4 and will result in an
18-
exception at execution time if used.
1916
...

docs/includes/apiargs-MongoDBCollection-common-option.yaml

-9
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ type: array
44
description: |
55
An array of filter documents that determines which array elements to modify
66
for an update operation on an array field.
7-
8-
This is not supported for server versions prior to 3.6 and will result in an
9-
exception at execution time if used.
107
interface: phpmethod
118
operation: ~
129
optional: true
@@ -17,9 +14,6 @@ type: boolean
1714
description: |
1815
If ``true``, allows the write operation to circumvent document level
1916
validation. Defaults to ``false``.
20-
21-
This option is available in MongoDB 3.2+ and is ignored for older server
22-
versions, which do not support document level validation.
2317
interface: phpmethod
2418
operation: ~
2519
optional: true
@@ -40,9 +34,6 @@ description: |
4034
:manual:`Read concern </reference/read-concern>` to use for the operation.
4135
Defaults to the collection's read concern.
4236
43-
This is not supported for server versions prior to 3.2 and will result in an
44-
exception at execution time if used.
45-
4637
It is not possible to specify a :manual:`read concern
4738
</reference/read-concern>` for individual operations as part of a
4839
transaction. Instead, set the ``readConcern`` option when starting the

docs/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,4 @@ source:
7878
post: |
7979
This only applies when a :ref:`$out <agg-out>` or :ref:`$merge <agg-merge>`
8080
stage is specified.
81-
82-
This is not supported for server versions prior to 3.4 and will result in an
83-
exception at execution time if used.
8481
...

docs/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,4 @@ post: |
105105
source:
106106
file: apiargs-MongoDBCollection-common-option.yaml
107107
ref: writeConcern
108-
post: |
109-
This is not supported for server versions prior to 3.4 and will result in an
110-
exception at execution time if used.
111108
...

docs/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,4 @@ post: |
1717
source:
1818
file: apiargs-MongoDBCollection-common-option.yaml
1919
ref: writeConcern
20-
post: |
21-
This is not supported for server versions prior to 3.4 and will result in an
22-
exception at execution time if used.
2320
...

docs/includes/apiargs-MongoDBCollection-method-drop-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@ post: |
1313
source:
1414
file: apiargs-MongoDBCollection-common-option.yaml
1515
ref: writeConcern
16-
post: |
17-
This is not supported for server versions prior to 3.4 and will result in an
18-
exception at execution time if used.
1916
...

docs/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,4 @@ post: |
1919
source:
2020
file: apiargs-MongoDBCollection-common-option.yaml
2121
ref: writeConcern
22-
post: |
23-
This is not supported for server versions prior to 3.4 and will result in an
24-
exception at execution time if used.
2522
...

docs/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,4 @@ post: |
1717
source:
1818
file: apiargs-MongoDBCollection-common-option.yaml
1919
ref: writeConcern
20-
post: |
21-
This is not supported for server versions prior to 3.4 and will result in an
22-
exception at execution time if used.
2320
...

docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,4 @@ post: |
3838
source:
3939
file: apiargs-MongoDBCollection-common-option.yaml
4040
ref: writeConcern
41-
post: |
42-
This is not supported for server versions prior to 3.2 and will result in an
43-
exception at execution time if used.
4441
...

docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,4 @@ source:
5959
source:
6060
file: apiargs-MongoDBCollection-common-option.yaml
6161
ref: writeConcern
62-
post: |
63-
This is not supported for server versions prior to 3.2 and will result in an
64-
exception at execution time if used.
6562
...

docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,4 @@ source:
6565
source:
6666
file: apiargs-MongoDBCollection-common-option.yaml
6767
ref: writeConcern
68-
post: |
69-
This is not supported for server versions prior to 3.2 and will result in an
70-
exception at execution time if used.
7168
...

docs/includes/apiargs-MongoDBCollection-method-rename-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ source:
1111
source:
1212
file: apiargs-MongoDBCollection-common-option.yaml
1313
ref: writeConcern
14-
post: |
15-
This is not supported for server versions prior to 3.4 and will result in an
16-
exception at execution time if used.
1714
---
1815
arg_name: option
1916
name: dropTarget

docs/includes/apiargs-MongoDBDatabase-common-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ type: :php:`MongoDB\\Driver\\ReadConcern <class.mongodb-driver-readconcern>`
44
description: |
55
:manual:`Read concern </reference/read-concern>` to use for the operation.
66
Defaults to the database's read concern.
7-
8-
This is not supported for server versions prior to 3.2 and will result in an
9-
exception at execution time if used.
107
interface: phpmethod
118
operation: ~
129
optional: true

docs/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,4 @@ source:
5454
post: |
5555
This only applies when a :ref:`$out <agg-out>` or :ref:`$merge <agg-merge>`
5656
stage is specified.
57-
58-
This is not supported for server versions prior to 3.4 and will result in an
59-
exception at execution time if used.
6057
...

docs/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,4 @@ optional: true
265265
source:
266266
file: apiargs-MongoDBDatabase-common-option.yaml
267267
ref: writeConcern
268-
post: |
269-
This is not supported for server versions prior to 3.4 and will result in an
270-
exception at execution time if used.
271268
...

docs/includes/apiargs-MongoDBDatabase-method-drop-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@ post: |
1313
source:
1414
file: apiargs-MongoDBDatabase-common-option.yaml
1515
ref: writeConcern
16-
post: |
17-
This is not supported for server versions prior to 3.4 and will result in an
18-
exception at execution time if used.
1916
...

docs/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@ post: |
1313
source:
1414
file: apiargs-MongoDBDatabase-common-option.yaml
1515
ref: writeConcern
16-
post: |
17-
This is not supported for server versions prior to 3.4 and will result in an
18-
exception at execution time if used.
1916
...

docs/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ post: |
1111
source:
1212
file: apiargs-MongoDBDatabase-common-option.yaml
1313
ref: writeConcern
14-
post: |
15-
This is not supported for server versions prior to 3.4 and will result in an
16-
exception at execution time if used.
1714
---
1815
arg_name: option
1916
name: dropTarget

docs/includes/apiargs-aggregate-option.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ source:
2525
post: |
2626
This only applies when using the :ref:`$out <agg-out>` and
2727
:ref:`$out <agg-merge>` stages.
28-
29-
Document validation requires MongoDB 3.2 or later: if you are using an earlier
30-
version of MongoDB, this option will be ignored.
3128
---
3229
arg_name: option
3330
name: comment

docs/includes/apiargs-common-option.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ description: |
88
mandatory; all other collation fields are optional. For descriptions of the
99
fields, see :manual:`Collation Document
1010
</reference/collation/#collation-document>`.
11-
12-
This option is available in MongoDB 3.4+ and will result in an exception at
13-
execution time if specified for an older server version.
1411
interface: phpmethod
1512
operation: ~
1613
optional: true
@@ -68,8 +65,6 @@ name: session
6865
type: :php:`MongoDB\\Driver\\Session <class.mongodb-driver-session>`
6966
description: |
7067
Client session to associate with the operation.
71-
72-
Sessions are not supported for server versions prior to 3.6.
7368
interface: phpmethod
7469
operation: ~
7570
optional: true

docs/reference/exception-classes.txt

-6
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ MongoDB\\Exception\\UnsupportedException
7070
selected server. It is used sparingly in cases where silently ignoring the
7171
unsupported option might otherwise lead to unexpected behavior.
7272

73-
For example, the ``collation`` option for
74-
:phpmethod:`MongoDB\\Collection::deleteOne()` is only supported by
75-
MongoDB 3.4+. Since collation determines how a document is matched, silently
76-
ignoring the option for an older server version could result in an
77-
unintended document being deleted.
78-
7973
This class extends the library's :phpclass:`RuntimeException
8074
<MongoDB\\Exception\\RuntimeException>` class.
8175

docs/reference/method/MongoDBCollection-count.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ metadata. Even when provided with a query filter the ``count`` command can
5656
return inaccurate results with a sharded cluster if orphaned documents exist or
5757
if a chunk migration is in progress. The
5858
:phpmethod:`MongoDB\\Collection::countDocuments()` method avoids these sharded
59-
cluster problems entirely when used with MongoDB 3.6+, and when a primary read
60-
preference with older sharded clusters.
59+
cluster problems entirely.
6160

6261
.. include:: /includes/extracts/note-bson-comparison.rst
6362

docs/reference/method/MongoDBCollection-countDocuments.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Consider the following alternatives to these restricted operators:
7777
- :query:`$geoWithin` with :query:`$centerSphere`
7878

7979
* - :query:`$where`
80-
- :query:`$expr` (requires MongoDB 3.6+)
80+
- :query:`$expr`
8181

8282
.. include:: /includes/extracts/note-bson-comparison.rst
8383

docs/reference/method/MongoDBDatabase-createCollection.txt

+3-5
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@ Definition
4141

4242
.. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-option.rst
4343

44-
Note that not all options are available on all versions of MongoDB. Document
45-
validation, for example, was added in MongoDB 3.2; similarly, the WiredTiger
46-
storage engine is available only for MongoDB 3.0 and later. Refer to the
47-
:manual:`create </reference/command/create>` command reference in the MongoDB
48-
manual for compatibility considerations.
44+
Note that not all options are available on all versions of MongoDB. Refer to
45+
the :manual:`create </reference/command/create>` command reference in the
46+
MongoDB manual for compatibility considerations.
4947

5048
Return Values
5149
-------------

src/Client.php

+2-8
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ class Client
5151
'root' => BSONDocument::class,
5252
];
5353

54-
/** @var integer */
55-
private static $wireVersionForReadConcern = 4;
56-
57-
/** @var integer */
58-
private static $wireVersionForWritableCommandWriteConcern = 5;
59-
6054
/** @var string */
6155
private static $handshakeSeparator = ' / ';
6256

@@ -215,7 +209,7 @@ public function dropDatabase($databaseName, array $options = [])
215209

216210
$server = select_server($this->manager, $options);
217211

218-
if (! isset($options['writeConcern']) && server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern) && ! is_in_transaction($options)) {
212+
if (! isset($options['writeConcern']) && ! is_in_transaction($options)) {
219213
$options['writeConcern'] = $this->writeConcern;
220214
}
221215

@@ -372,7 +366,7 @@ public function watch(array $pipeline = [], array $options = [])
372366

373367
$server = select_server($this->manager, $options);
374368

375-
if (! isset($options['readConcern']) && server_supports_feature($server, self::$wireVersionForReadConcern) && ! is_in_transaction($options)) {
369+
if (! isset($options['readConcern']) && ! is_in_transaction($options)) {
376370
$options['readConcern'] = $this->readConcern;
377371
}
378372

0 commit comments

Comments
 (0)