Skip to content

Commit ddef03a

Browse files
author
Sam Kleinman
committed
merge: DOCS-133 apply ops documentation
2 parents 423564f + 3bf5b0b commit ddef03a

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

source/reference/commands.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,14 +2466,26 @@ Internal Use
24662466

24672467
.. write-lock, slave-ok
24682468

2469-
.. dbcommand:: applyOps
2469+
.. dbcommand:: applyOps(operations, preCondition:[ ns: namespace, q: query, res: result ])
2470+
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.
24702476

24712477
:dbcommand:`applyOps` is an internal command that supports sharding
24722478
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.
24732480

2474-
.. write-lock
2481+
.. code-block:: javascript
2482+
2483+
db.runCommand({ { applyOps: <operations>, preCondition: [ ns: <namespace>, q: <query>, res: <result> ] } )
2484+
2485+
2486+
.. write-lock
24752487

2476-
.. see: DOCS-133; SERVER-4259
2488+
.. see: DOCS-133; SERVER-4259
24772489

24782490
.. dbcommand:: replSetElect
24792491

0 commit comments

Comments
 (0)