Skip to content

Commit d3a255f

Browse files
kanchana-mongodbandf-mongodb
authored andcommitted
DOCS-12912 Ignore value of oplogReplay option
1 parent 729c283 commit d3a255f

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

source/reference/command/find.txt

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ Definition
3030
Syntax
3131
------
3232

33-
.. versionchanged:: 4.2
33+
.. versionchanged:: 4.4
3434

35-
MongoDB removes the deprecated ``maxScan`` option to the
36-
:dbcommand:`find` command. Use the ``maxTimeMS`` option instead.
35+
MongoDB deprecates the ``oplogReplay`` option to the :dbcommand:`find`
36+
command. The optimization enabled by this flag in previous versions now
37+
happens automatically for eligible queries on the oplog. Therefore,
38+
you don't need to specify this flag. If specified, the server accepts
39+
the flag for backwards compatibility, but the flag has no effect.
3740

3841
The :dbcommand:`find` command has the following syntax:
3942

@@ -67,6 +70,8 @@ The :dbcommand:`find` command has the following syntax:
6770
}
6871
)
6972

73+
.. _find-cmd-fields:
74+
7075
Command Fields
7176
~~~~~~~~~~~~~~
7277

@@ -284,13 +289,14 @@ The command accepts the following fields:
284289

285290
- boolean
286291

287-
- Optional. An internal command for replaying a :ref:`replica set's oplog
292+
- .. deprecated:: 4.4
293+
294+
Optional. An internal command for replaying a :ref:`replica set's oplog
288295
<replica-set-oplog>`.
289296

290-
To use ``oplogReplay``, the ``find`` field must refer to a
291-
:doc:`capped collection </core/capped-collections>` and you must
292-
provide a ``filter`` option comparing the ``ts`` document field to a
293-
:data:`timestamp` using one of the following comparison operators:
297+
To use ``oplogReplay``, the ``find`` field must provide a ``filter``
298+
option comparing the ``ts`` document field to a :data:`timestamp` using
299+
one of the following comparison operators:
294300

295301
* :expression:`$gte`
296302
* :expression:`$gt`
@@ -306,11 +312,18 @@ The command accepts the following fields:
306312
oplogReplay: true,
307313
filter: { ts: { $gte: new Timestamp(1514764800, 0) } } }
308314

309-
.. versionchanged:: 3.6
310-
311-
:expression:`$eq` is now supported.
312-
313-
315+
.. admonition:: Deprecated
316+
:class: note
317+
318+
.. versionchanged:: 4.4
319+
320+
Starting in MongoDB 4.4, the ``oplogReplay`` field is deprecated.
321+
``find`` fields that use the :expression:`$gte`, :expression:`$gt`,
322+
or :expression:`$eq` ``filter`` predicated on the ``ts`` field
323+
will automatically utilize the storage format of the :ref:`replica
324+
set's oplog <replica-set-oplog>` to execute the command more
325+
efficiently. If specified, the server accepts the ``oplogReplay``
326+
flag for backwards compatibility, but the flag has no effect.
314327

315328
* - ``noCursorTimeout``
316329

source/reference/mongodb-wire-protocol.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,13 @@ collection. The format of the OP_QUERY message is:
361361
invalid at some point (CursorNotFound) – for example if the
362362
final object it references were deleted.
363363

364-
- ``2`` corresponds to SlaveOk.Allow query of replica slave.
364+
- ``2`` corresponds to SlaveOk. Allow query of replica slave.
365365
Normally these return an error except for namespace "local".
366366

367-
- ``3`` corresponds to OplogReplay. Internal replication use
368-
only - driver should not set.
367+
- ``3`` corresponds to OplogReplay. Starting in MongoDB 4.4, you
368+
need not specify this flag because the optimization
369+
automatically happens for eligible queries on the oplog. See
370+
:ref:`oplogReplay <find-cmd-fields>` for more information.
369371

370372
- ``4`` corresponds to NoCursorTimeout. The server normally
371373
times out idle cursors after an inactivity period (10 minutes)

0 commit comments

Comments
 (0)