@@ -2466,26 +2466,42 @@ Internal Use
2466
2466
2467
2467
.. write-lock, slave-ok
2468
2468
2469
- .. dbcommand:: applyOps(operations, preCondition:[ ns: namespace, q: query, res: result ])
2469
+ .. dbcommand:: applyOps
2470
2470
2471
2471
:param array operations: an array of operations to perform.
2472
- :param preCondition: Optional. Specifies a precondition which must be met before applying
2473
- the entry from the :term:`oplog`. Use :code:`ns` to specify a :term:`namespace`,
2474
- :code:`q` to specify a :term:`query` and :code:`res` to specify the
2475
- result which the query should match.
2476
2472
2477
- :dbcommand:`applyOps` is an internal command that supports sharding
2478
- functionality.
2479
- It applies :term:`oplog` entries passed to the command in the <operations> array, to a database, or collection if you specify the :term:`ns` option.
2473
+ :param array preCondition: Optional. Defines one or more conditions that the destination must meet
2474
+ applying the entries from the ``<operations>`` array. ``ns`` to
2475
+ specify a :term:`namespace`, ``q`` to specify a :term:`query` and
2476
+ ``res`` to specify the result that the query should match. You may
2477
+ specify, zero, one, or many ``preCondition`` documents.
2478
+
2479
+ :dbcommand:`applyOps` provides a way to apply entries from an
2480
+ :term:`oplog` created by :term:`replica set` members and
2481
+ :term:`master` instances in a master/:term:`slave`
2482
+ deployment. :dbcommand:`applyOps` is primarily an internal command
2483
+ to support sharding functionality, and has the following prototype
2484
+ form:
2480
2485
2481
- .. code-block:: javascript
2486
+ .. code-block:: javascript
2487
+
2488
+ db.runCommand( { applyOps: [ <operations> ], preCondition: [ { ns: <namespace>, q: <query>, res: <result> } ] } )
2482
2489
2483
- db.runCommand({ { applyOps: <operations>, preCondition: [ ns: <namespace>, q: <query>, res: <result> ] } )
2490
+ :dbcommand:`applyOps` applies oplog entries from the
2491
+ ``<operations>`` array, to the :program:`mongod` instance. The
2492
+ ``preCondition`` array provides the ability to specify conditions
2493
+ that must be true in order to apply the oplog entry.
2484
2494
2495
+ You can specify as many ``preCondition`` sets as needed. If you
2496
+ specify the ``ns`` option, :dbcommand:`applyOps` will only apply
2497
+ oplog entries for the :term:`collection` described by that
2498
+ namespace. You may also specify a query in the ``q`` field with a
2499
+ corresponding expected result in the ``res`` field that must match
2500
+ in order to apply the oplog entry.
2485
2501
2486
- .. write-lock
2502
+ .. write-lock
2487
2503
2488
- .. see: DOCS-133; SERVER-4259
2504
+ .. see: DOCS-133; SERVER-4259
2489
2505
2490
2506
.. dbcommand:: replSetElect
2491
2507
0 commit comments