Skip to content

Commit c86251c

Browse files
mungitoperritojeff-allen-mongo
authored andcommitted
DOCSP-17329 remove legacy wire protocols
1 parent 2fdf33b commit c86251c

Some content is hidden

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

50 files changed

+221
-1191
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Any code explicitly using ``getLastError``, ``db.getLastError()``, or
2+
``db.getLastErrorObj()`` should instead use the CRUD API to issue the
3+
write with the desired :ref:`write concern <write-concern>`.
4+
Information about the success or failure of the write operation will be
5+
provided directly by the driver as a return value.
6+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Starting in MongoDB 5.1, certain wire protocol opcodes are removed from
2+
the :binary:`~bin.mongo` shell. The shell will not connect to any
3+
version of :binary:`~bin.mongod` or :binary:`~bin.mongos` less than
4+
3.6 since these versions do not support the OP_MSG RPC protocol.
5+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MongoDB 5.1 removes the following parameters from the
2+
:binary:`~bin.mongo` shell:
3+
4+
.. list-table::
5+
:header-rows: 1
6+
:widths: 25 75
7+
8+
* - Removed Parameters
9+
- Description
10+
* - ``--useLegacyWriteOps``
11+
- The ability to use OP_INSERT, OP_UPDATE, and OP_DELETE is
12+
removed. The shell will only use OP_MSG write commands.
13+
* - ``--writeMode``
14+
- The ability to use OP_INSERT, OP_UPDATE, and OP_DELETE is
15+
removed. The shell will only use OP_MSG write commands.
16+
* - ``--readMode``
17+
- The ability to use OP_QUERY legacy find is removed. The shell
18+
will only use OP_MSG find commands.
19+
* - ``--rpcProtocols``
20+
- Support for the OP_QUERY RPC protocol is removed. The shell
21+
will always use the OP_MSG RPC protocol.
22+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Optional. The level of :ref:`write concern <write-concern>` for the
2+
operation. See :ref:`wc-specs`.
3+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. note::
22

3-
For bulk inserts on sharded clusters, the :dbcommand:`getLastError`
3+
For bulk inserts on sharded clusters, the ``getLastError``
44
command alone is insufficient to verify success. Applications
55
should must verify the success of bulk inserts in application
66
logic.

source/reference/command.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,6 @@ Query and Write Operation Commands
131131

132132
- Returns and modifies a single document.
133133

134-
* - :dbcommand:`getLastError`
135-
136-
- Returns the success status of the last operation.
137-
138134
* - :dbcommand:`getMore`
139135

140136
- Returns batches of documents currently pointed to by the cursor.

source/reference/command/createRole.txt

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -53,69 +53,35 @@ Definition
5353
:widths: 20 20 80
5454

5555
* - Field
56-
5756
- Type
58-
5957
- Description
60-
6158
* - ``createRole``
62-
6359
- string
64-
6560
- The name of the new role.
66-
67-
68-
6961
* - ``privileges``
70-
7162
- array
72-
7363
- The privileges to grant the role. A privilege consists of a resource
7464
and permitted actions. For the syntax of a privilege, see the
7565
:data:`~admin.system.roles.privileges` array.
7666

7767
You must include the ``privileges`` field. Use an
7868
empty array to specify *no* privileges.
79-
80-
81-
8269
* - ``roles``
83-
8470
- array
85-
8671
- An array of roles from which this role inherits privileges.
8772

8873
You must include the ``roles`` field. Use an empty array to specify
8974
*no* roles to inherit from.
90-
91-
92-
9375
* - ``authenticationRestrictions``
94-
9576
- array
96-
9777
- Optional.
98-
9978
.. include:: /includes/fact-auth-restrictions-role-desc.rst
100-
101-
102-
10379
* - ``writeConcern``
104-
10580
- document
106-
107-
- Optional. The level of :doc:`write concern </reference/write-concern>` to apply
108-
to this operation. The ``writeConcern`` document uses the same fields
109-
as the :dbcommand:`getLastError` command.
110-
111-
112-
81+
- .. include:: /includes/fact-write-concern-spec-link.rst
11382
* - ``comment``
114-
11583
- any
116-
11784
- .. include:: /includes/extracts/comment-content.rst
118-
11985
.. versionadded:: 4.4
12086

12187
.. |local-cmd-name| replace:: :dbcommand:`createRole`

source/reference/command/createUser.txt

Lines changed: 17 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,13 @@ Definition
5454
:widths: 20 20 80
5555

5656
* - Field
57-
5857
- Type
59-
6058
- Description
61-
6259
* - ``createUser``
63-
6460
- string
65-
6661
- The name of the new user.
67-
68-
69-
7062
* - ``pwd``
71-
7263
- string
73-
7464
- The user's password. The ``pwd`` field is not
7565
required if you run |local-cmd-name| on the ``$external``
7666
database to create users who have credentials stored externally to
@@ -79,81 +69,52 @@ Definition
7969
The value can be either:
8070

8171
- the user's password in cleartext string, or
82-
8372
- :method:`passwordPrompt()` to prompt for the user's password.
84-
73+
8574
.. tip::
8675

8776
.. include:: /includes/extracts/4.2-changes-passwordPrompt.rst
88-
89-
90-
77+
9178
* - ``customData``
92-
9379
- document
94-
9580
- Optional. Any arbitrary information. This field can be used to store any data
9681
an admin wishes to associate with this particular user. For example,
9782
this could be the user's full name or employee id.
98-
99-
100-
83+
10184
* - ``roles``
102-
10385
- array
104-
10586
- The roles granted to the user. Can specify an empty array ``[]`` to
10687
create users without roles.
107-
108-
109-
88+
11089
* - ``digestPassword``
111-
11290
- boolean
113-
11491
- Optional. Indicates whether the server or the client digests the password.
115-
92+
11693
If true, the server receives undigested password from the client and
11794
digests the password.
118-
95+
11996
If false, the client digests the password and passes the digested
12097
password to the server. Not compatible with ``SCRAM-SHA-256``
121-
98+
12299
.. versionchanged:: 4.0
123100

124101
The default value is ``true``. In earlier versions, the default
125102
value is ``false``.
126-
127-
128-
103+
129104
* - ``writeConcern``
130-
131105
- document
132-
133-
- Optional. The level of :doc:`write concern </reference/write-concern>` for the
134-
creation operation. The ``writeConcern`` document takes the same
135-
fields as the :dbcommand:`getLastError` command.
136-
137-
138-
106+
- .. include:: /includes/fact-write-concern-spec-link.rst
139107
* - ``authenticationRestrictions``
140-
141108
- array
142-
143109
- Optional. The authentication restrictions the server enforces on the created
144110
user. Specifies a list of IP addresses and
145111
:abbr:`CIDR (Classless Inter-Domain Routing)` ranges from which the
146112
user is allowed to connect to the server or from which the server can
147113
accept users.
148-
114+
149115
.. versionadded:: 3.6
150-
151-
152-
153116
* - ``mechanisms``
154-
155117
- array
156-
157118
- Optional. Specify the specific SCRAM mechanism or mechanisms for creating
158119
SCRAM user credentials. If :parameter:`authenticationMechanisms` is
159120
specified, you can only specify a subset of the
@@ -162,16 +123,11 @@ Definition
162123
Valid values are:
163124

164125
- ``"SCRAM-SHA-1"``
165-
166-
- Uses the ``SHA-1`` hashing function.
167-
126+
- Uses the ``SHA-1`` hashing function.
168127
- ``"SCRAM-SHA-256"``
169-
170-
- Uses the ``SHA-256`` hashing function.
171-
172-
- Requires featureCompatibilityVersion set to ``4.0``.
173-
174-
- Requires digestPassword to be ``true``.
128+
- Uses the ``SHA-256`` hashing function.
129+
- Requires featureCompatibilityVersion set to ``4.0``.
130+
- Requires digestPassword to be ``true``.
175131

176132
The default for featureCompatibilityVersion is ``4.0`` is both
177133
``SCRAM-SHA-1`` and ``SCRAM-SHA-256``.
@@ -180,13 +136,9 @@ Definition
180136
``SCRAM-SHA-1``.
181137

182138
.. versionadded:: 4.0
183-
184-
185-
139+
186140
* - ``digestPassword``
187-
188141
- boolean
189-
190142
- Optional. Indicates whether the server or the client digests the password.
191143

192144
If true, the server receives undigested password from the client and
@@ -199,14 +151,11 @@ Definition
199151

200152
The default value is ``true``. In earlier versions, the default
201153
value is ``false``.
202-
203-
204-
* - ``comment``
205154

155+
* - ``comment``
206156
- any
207-
208157
- .. include:: /includes/extracts/comment-content.rst
209-
158+
210159
.. versionadded:: 4.4
211160

212161

source/reference/command/dropAllRolesFromDatabase.txt

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,37 +42,20 @@ Definition
4242
:widths: 20 20 80
4343

4444
* - Field
45-
4645
- Type
47-
4846
- Description
49-
5047
* - ``dropAllRolesFromDatabase``
51-
5248
- integer
53-
5449
- Specify ``1`` to drop all :ref:`user-defined <user-defined-roles>`
5550
roles from the database where the command is run.
56-
57-
58-
5951
* - ``writeConcern``
60-
6152
- document
62-
63-
- Optional. The level of :doc:`write concern </reference/write-concern>` for the
64-
removal operation. The ``writeConcern`` document takes the same
65-
fields as the :dbcommand:`getLastError` command.
66-
67-
53+
- /includes/source/fact-write-concern-spec-link.rst
6854
* - ``comment``
69-
7055
- any
71-
7256
- .. include:: /includes/extracts/comment-content.rst
73-
74-
.. versionadded:: 4.4
7557

58+
.. versionadded:: 4.4
7659

7760
Required Access
7861
---------------

source/reference/command/dropAllUsersFromDatabase.txt

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,34 +41,18 @@ Definition
4141
:widths: 20 20 80
4242

4343
* - Field
44-
4544
- Type
46-
4745
- Description
48-
4946
* - ``dropAllUsersFromDatabase``
50-
5147
- integer
52-
5348
- Specify ``1`` to drop all the users from the current database.
54-
55-
56-
5749
* - ``writeConcern``
58-
5950
- document
60-
61-
- Optional. The level of :doc:`write concern </reference/write-concern>` for the
62-
removal operation. The ``writeConcern`` document takes the same
63-
fields as the :dbcommand:`getLastError` command.
64-
65-
51+
- .. include:: /includes/fact-write-concern-spec-link.rst
6652
* - ``comment``
67-
6853
- any
69-
7054
- .. include:: /includes/extracts/comment-content.rst
71-
55+
7256
.. versionadded:: 4.4
7357

7458

0 commit comments

Comments
 (0)