Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions source/reference/command/getLastError.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Definition

.. dbcommand:: getLastError

Starting in MongoDB 5.0, :dbcommand:`getLastError` is deprecated. For
more information and alternatives, see :ref:`Deprecated Wire Protocol
Opcodes <deprecated-wire-protocol-opcodes>`.

.. include:: /includes/extracts/fact-2.6-wc-gle-change-cmd-getLastError.rst

Returns the error status of the preceding write operation on the
Expand Down
4 changes: 4 additions & 0 deletions source/reference/method/db.getLastError.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Definition

.. method:: db.getLastError(<w>, <wtimeout>)

Starting in MongoDB 5.0, :method:`db.getLastError()` is deprecated.
For more information and alternatives, see :ref:`Deprecated Wire
Protocol Opcodes <deprecated-wire-protocol-opcodes>`.

.. include:: /includes/extracts/db.getLastError-definition.rst

.. include:: /includes/extracts/fact-2.6-wc-gle-change-method-db.getLastError.rst
Expand Down
5 changes: 5 additions & 0 deletions source/reference/method/db.getLastErrorObj.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ Definition

.. method:: db.getLastErrorObj(w, wtimeout, j)

Starting in MongoDB 5.0, :method:`db.getLastErrorObj()` is
deprecated. For more information and alternatives, see
:ref:`Deprecated Wire Protocol Opcodes
<deprecated-wire-protocol-opcodes>`.

.. include:: /includes/extracts/db.getLastErrorObj-definition.rst

.. include:: /includes/extracts/fact-2.6-wc-gle-change-method-db.getLastErrorObj.rst
Expand Down
19 changes: 18 additions & 1 deletion source/release-notes/5.0-compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ Deprecations
the :ref:`clientMetadata <audit-message-clientMetadata>` audit message
instead.

.. _deprecated-wire-protocol-opcodes:

Deprecated Wire Protocol Opcodes
````````````````````````````````

Expand All @@ -391,9 +393,24 @@ MongoDB 5.0 deprecates the following
- ``OP_KILL_CURSORS``

Newer driver versions use :ref:`OP_MSG <wire-op-msg>` instead of these
deprecated op codes. To ensure your driver uses the most up-to-date wire
deprecated op codes.

The related commands and methods are also deprecated in MongoDB 5.0:

- :dbcommand:`getLastError`
- :method:`db.getLastError()`
- :method:`db.getLastErrorObj()`

To ensure your driver uses the most up-to-date wire
protocol, upgrade your driver to a 5.0-compatible version.

Any code explicitly using :dbcommand:`getLastError`,
:method:`db.getLastError()`, or :method:`db.getLastErrorObj()`
should instead use the CRUD API to issue the write with
the designed :doc:`write concern </reference/write-concern>`.
Information about the success or failure of the write operation will be
provided directly by the driver as a return value.

.. _5.0-compatibility-enabled:

5.0 Feature Compatibility
Expand Down