- Reference >
- Database Commands >
- Replication Commands >
- applyOps
applyOps¶
-
applyOps¶ Applies specified oplog entries to a
mongodinstance. TheapplyOpscommand is primarily an internal command to support sharded clusters.The
applyOpscommand has the following prototype form:The
applyOpscommand takes a document with the following fields:Field Type Description applyOpsarray The oplog entries to apply. preConditionarray Optional. An array of documents that contain the conditions that must be true in order to apply the oplog entry. Each document contains a set of conditions, as described in the next table. The
preConditionarray takes one or more documents with the following fields:Field Type Description nsstring A namespace. If you use this field, applyOpsapplies oplog entries only for the collection described by this namespace.qstring Specifies the query that produces the results specified in the resfield.resstring The results of the query in the qfield that must match to apply the oplog entry.
Warning
This command obtains a global write lock and will block other operations until it has completed.