发布于 2015-09-14 15:05:40 | 422 次阅读 | 评论: 0 | 来源: 网络整理

$isolated

$isolated isolation operator isolates a write operation that affects multiple documents from other write operations.

注解

The $isolated isolation operator does not provide “all-or-nothing” atomicity for write operations.

Consider the following example:

db.foo.update( { field1 : 1 , $isolated : 1 }, { $inc : { field2 : 1 } } , { multi: true } )

Without the $isolated operator, multi-updates will allow other operations to interleave with this updates. If these interleaved operations contain writes, the update operation may produce unexpected results. By specifying $isolated you can guarantee isolation for the entire multi-update.

警告

$isolated does not work with sharded clusters.

也可以参考

See db.collection.update() for more information about the db.collection.update() method.

$atomic

2.2 版后已移除: The $isolated replaces $atomic.

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

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