Skip to content

Commit bf6a014

Browse files
(DOCSP-11311): Remove mention of hint for findAndModify v4.2
1 parent 7231ff1 commit bf6a014

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

source/reference/command/findAndModify.txt

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,7 @@ Definition
229229

230230
- document or string
231231

232-
- *New in version 4.2. Changed in version 4.4*
233-
234-
Optional. A document or string that specifies the
232+
- Optional. A document or string that specifies the
235233
:doc:`index </indexes>` to use to support the ``query``.
236234

237235
The option can take an index specification document or the
@@ -240,14 +238,10 @@ Definition
240238
If you specify an index that does not exist, the operation
241239
errors.
242240

243-
In MongoDB 4.2, you can only specify a ``hint`` for
244-
:dbcommand:`findAndModify` commands where ``remove`` is
245-
``false``. Starting in MongoDB 4.4, you can specify a
246-
``hint`` for :dbcommand:`findAndModify` commands where
247-
``remove`` is either ``true`` or ``false``.
248-
249241
For an example, see :ref:`ex-findAndModify-hint`.
250242

243+
.. versionadded:: 4.4
244+
251245
* - ``comment``
252246

253247
- any
@@ -989,8 +983,8 @@ After the operation, the collection has the following documents:
989983

990984
.. _ex-findAndModify-hint:
991985

992-
Specify ``hint`` for Delete Operations
993-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
986+
Specify ``hint`` for ``findAndModify`` Operations
987+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
994988

995989
.. versionadded:: 4.4
996990

@@ -1015,7 +1009,7 @@ Create the following indexes on the collection:
10151009
db.members.createIndex( { status: 1 } )
10161010
db.members.createIndex( { points: 1 } )
10171011

1018-
The following delete operation explicitly hints to use the index
1012+
The following operation explicitly hints to use the index
10191013
``{ status: 1 }``:
10201014

10211015
.. code-block:: javascript

source/release-notes/4.4.txt

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,24 +1763,28 @@ aggregation stage return:
17631763
- :data:`~collStats.freeStorageSize`, which is the amount of storage
17641764
available for reuse.
17651765

1766-
Delete and Hint
1767-
~~~~~~~~~~~~~~~
1766+
Hint Available for Additional Database Commands
1767+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1768+
1769+
Starting in MongoDB 4.4, the following database commands can accept
1770+
a ``hint`` argument to specify the index to use:
1771+
1772+
- The :dbcommand:`delete` command and the associated
1773+
:binary:`~bin.mongo` shell methods
1774+
:method:`db.collection.deleteOne()` and
1775+
:method:`db.collection.deleteMany()`.
17681776

1769-
Starting in MongoDB 4.4, the :dbcommand:`delete` command and the
1770-
associated :binary:`~bin.mongo` shell methods
1771-
:method:`db.collection.deleteOne()` and
1772-
:method:`db.collection.deleteMany()` can accept a ``hint`` argument to
1773-
specify the index to use.
1777+
- The :dbcommand:`findAndModify` command and the associated
1778+
:binary:`~bin.mongo` shell methods:
17741779

1775-
Additionally, starting in MongoDB 4.4, when a :dbcommand:`findAndModify`
1776-
command has ``remove`` set to ``true``, the command can accept a
1777-
``hint`` argument to specify the index to use.
1780+
- :method:`db.collection.findAndModify()`,
1781+
- :method:`db.collection.findOneAndDelete()`,
1782+
- :method:`db.collection.findOneAndReplace()`,
1783+
- :method:`db.collection.findOneAndUpdate()`
17781784

17791785
See:
17801786

17811787
- :dbcommand:`delete`
1782-
- :method:`db.collection.deleteOne()`
1783-
- :method:`db.collection.deleteMany()`
17841788
- :dbcommand:`findAndModify`
17851789

17861790
JavaScript Execution on ``mongos``

0 commit comments

Comments
 (0)