Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions source/reference/commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2465,14 +2465,26 @@ Internal Use

.. write-lock, slave-ok

.. dbcommand:: applyOps
.. dbcommand:: applyOps(operations, preCondition:[ ns: namespace, q: query, res: result ])

:param array operations: an array of operations to perform.
:param preCondition: Optional. Specifies a precondition which must be met before applying
the entry from the :term:`oplog`. Use :code:`ns` to specify a :term:`namespace`,
:code:`q` to specify a :term:`query` and :code:`res` to specify the
result which the query should match.

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

.. write-lock
.. code-block:: javascript

db.runCommand({ { applyOps: <operations>, preCondition: [ ns: <namespace>, q: <query>, res: <result> ] } )


.. write-lock

.. see: DOCS-133; SERVER-4259
.. see: DOCS-133; SERVER-4259

.. dbcommand:: replSetElect

Expand Down