发布于 2015-09-14 15:03:27 | 206 次阅读 | 评论: 0 | 来源: 网络整理

applyOps
参数:
  • operations (array) – an array of operations to perform.
  • preCondition (array) – Optional. Defines one or more conditions that the destination must meet applying the entries from the <operations> array. Use ns to specify a namespace, q to specify a query and res to specify the result that the query should match. You may specify zero, one, or many preCondition documents.

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.

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务