Skip to content

Commit 3ab5fc4

Browse files
(DOCS-15381): update opcodes compatibility notes to mention getLastError (#1202)
* (DOCS-15381): update opcodes compatibility notes to mention getLastError * address review feedback * address review feedback * formatting and edits * adjust highlighting * clarify distinction * OP_QUERY adjustments * more adjustments * bold * reordering * change title * remove period * remove commas * add admonition title
1 parent 4c43d2f commit 3ab5fc4

File tree

2 files changed

+46
-39
lines changed

2 files changed

+46
-39
lines changed

source/release-notes/5.1-compatibility.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ will receive an error message like the following:
181181
.. code-block:: javascript
182182
:copyable: false
183183

184-
// Reformated for clarity. The message appears on a single line.
185-
186184
Connection handshake failed. Is your mongod 3.4 or older?
187185
:: caused by :: network error while attempting to run command
188186
'isMaster' on host '127.0.0.1:27017'

source/release-notes/6.0-compatibility.txt

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -249,21 +249,39 @@ evaluate to certain values. See :ref:`$mod behavior <mod-behavior>`.
249249
Legacy Opcodes Removed
250250
~~~~~~~~~~~~~~~~~~~~~~
251251

252-
MongoDB drivers have used :ref:`OP_MSG <wire-op-msg>` instead of
253-
:ref:`OP_QUERY <wire-op-query>` and the other legacy opcodes since
254-
MongoDB v3.6.
255-
256-
This release removes support for the following legacy opcodes:
252+
MongoDB 6.0 removes support for the following legacy opcodes and
253+
database commands:
257254

258255
- :ref:`OP_INSERT <wire-op-insert>`
259256
- :ref:`OP_DELETE <wire-op-delete>`
260257
- :ref:`OP_UPDATE <wire-op-update>`
261258
- :ref:`OP_KILL_CURSORS <wire-op-kill-cursors>`
262259
- :ref:`OP_GET_MORE <wire-op-get-more>`
263260
- :ref:`OP_QUERY <wire-op-query>`
261+
- ``getLastError``
262+
263+
.. warning:: Upgrade Drivers
264+
265+
To avoid disruption due to the removal of these opcodes, **upgrade your
266+
driver to the latest version**.
267+
268+
If you attempt to connect to a MongoDB 3.4 or older :binary:`mongod`
269+
instance with a MongoDB 5.1 or newer :binary:`~bin.mongo` shell, you
270+
will receive an error message like the following:
264271

265-
To avoid disruption due to the removal of these op codes, please
266-
upgrade your driver to the latest version.
272+
.. code-block:: none
273+
:copyable: false
274+
275+
Connection handshake failed. Is your mongod 3.4 or older?
276+
:: caused by :: network error while attempting to run command
277+
'isMaster' on host '127.0.0.1:27017'
278+
279+
mongod Responses to Legacy Opcodes
280+
``````````````````````````````````
281+
282+
Since MongoDB 3.6, MongoDB drivers have used :ref:`OP_MSG <wire-op-msg>`
283+
instead of :ref:`OP_QUERY <wire-op-query>` and the other legacy opcodes
284+
and commands.
267285

268286
:binary:`mongod` will close the connection and will not respond to:
269287

@@ -272,40 +290,31 @@ upgrade your driver to the latest version.
272290
- :ref:`OP_UPDATE <wire-op-update>`
273291
- :ref:`OP_KILL_CURSORS <wire-op-kill-cursors>`
274292

275-
:binary:`mongod` will return an error for:
293+
:binary:`mongod` will keep the connection open and return an error for:
276294

277-
- :ref:`OP_GET_MORE <wire-op-get-more>`
278-
- :ref:`OP_QUERY <wire-op-query>` legacy find
279-
280-
The :ref:`OP_QUERY <wire-op-query>` RPC protocol may be used with the
281-
following commands:
282-
283-
- ``_isSelf``
284-
- ``authenticate``
285-
- ``buildinfo``
286-
- ``buildInfo``
287-
- ``hello``
288-
- ``ismaster``
289-
- ``isMaster``
290-
- ``saslContinue``
291-
- ``saslStart``
292-
293-
:ref:`OP_QUERY <wire-op-query>` will return an error if it is used for
294-
a find operation. All other commands will be rejected if issued as
295-
:ref:`OP_QUERY <wire-op-query>`.
296-
297-
If you attempt to connect to a MongoDB 3.4, or older, :binary:`mongod`
298-
instance with a MongoDB 5.1 or newer :binary:`~bin.mongo` shell, you
299-
will receive an error message like the following:
295+
- The ``getLastError`` database command
296+
- :ref:`OP_GET_MORE <wire-op-get-more>`
297+
- :ref:`OP_QUERY <wire-op-query>` finds
298+
- Most :ref:`OP_QUERY <wire-op-query>`
299+
:abbr:`RPC (Remote Procedure Call)` command messages
300300

301-
.. code-block:: javascript
302-
:copyable: false
301+
.. note:: OP_QUERY RPC Commands
303302

304-
// Reformated for clarity. The message appears on a single line.
303+
The :ref:`OP_QUERY <wire-op-query>` :abbr:`RPC (Remote Procedure Call)`
304+
protocol may be used with the following commands:
305305

306-
Connection handshake failed. Is your mongod 3.4 or older?
307-
:: caused by :: network error while attempting to run command
308-
'isMaster' on host '127.0.0.1:27017'
306+
- ``_isSelf``
307+
- ``authenticate``
308+
- ``buildinfo``
309+
- ``buildInfo``
310+
- ``hello``
311+
- ``ismaster``
312+
- ``isMaster``
313+
- ``saslContinue``
314+
- ``saslStart``
315+
316+
All other commands will be rejected if issued as :ref:`OP_QUERY
317+
<wire-op-query>`.
309318

310319
.. _6.0-js-engine-change:
311320

0 commit comments

Comments
 (0)