发布于 2015-09-14 15:03:27 | 206 次阅读 | 评论: 0 | 来源: 网络整理
参数: |
|
---|
applyOps provides a way to apply entries from an oplog created by replica set members and master instances in a master/slave deployment. applyOps is primarily an internal command to support sharding functionality, and has the following prototype form:
db.runCommand( { applyOps: [ <operations> ], preCondition: [ { ns: <namespace>, q: <query>, res: <result> } ] } )
applyOps applies oplog entries from the <operations> array, to the mongod instance. The preCondition array provides the ability to specify conditions that must be true in order to apply the oplog entry.
You can specify as many preCondition sets as needed. If you specify the ns option, applyOps will only apply oplog entries for the collection described by that namespace. You may also specify a query in the q field with a corresponding expected result in the res field that must match in order to apply the oplog entry.
警告
This command obtains a global write lock and will block other operations until it has completed.