diff --git a/source/reference/command/getLastError.txt b/source/reference/command/getLastError.txt index fae5bd3d332..928cb68fdfd 100644 --- a/source/reference/command/getLastError.txt +++ b/source/reference/command/getLastError.txt @@ -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 `. + .. include:: /includes/extracts/fact-2.6-wc-gle-change-cmd-getLastError.rst Returns the error status of the preceding write operation on the diff --git a/source/reference/method/db.getLastError.txt b/source/reference/method/db.getLastError.txt index 1b6b735f307..636df2b23ea 100644 --- a/source/reference/method/db.getLastError.txt +++ b/source/reference/method/db.getLastError.txt @@ -15,6 +15,10 @@ Definition .. method:: db.getLastError(, ) + Starting in MongoDB 5.0, :method:`db.getLastError()` is deprecated. + For more information and alternatives, see :ref:`Deprecated Wire + Protocol Opcodes `. + .. include:: /includes/extracts/db.getLastError-definition.rst .. include:: /includes/extracts/fact-2.6-wc-gle-change-method-db.getLastError.rst diff --git a/source/reference/method/db.getLastErrorObj.txt b/source/reference/method/db.getLastErrorObj.txt index 7eb6c0f48bf..ac7921ad459 100644 --- a/source/reference/method/db.getLastErrorObj.txt +++ b/source/reference/method/db.getLastErrorObj.txt @@ -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 + `. + .. include:: /includes/extracts/db.getLastErrorObj-definition.rst .. include:: /includes/extracts/fact-2.6-wc-gle-change-method-db.getLastErrorObj.rst diff --git a/source/release-notes/5.0-compatibility.txt b/source/release-notes/5.0-compatibility.txt index 81b5dfbe473..3a50c36f401 100644 --- a/source/release-notes/5.0-compatibility.txt +++ b/source/release-notes/5.0-compatibility.txt @@ -376,6 +376,8 @@ Deprecations the :ref:`clientMetadata ` audit message instead. +.. _deprecated-wire-protocol-opcodes: + Deprecated Wire Protocol Opcodes ```````````````````````````````` @@ -391,9 +393,24 @@ MongoDB 5.0 deprecates the following - ``OP_KILL_CURSORS`` Newer driver versions use :ref:`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 `. +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