"snapshot"
¶New in version 4.0.版本4.0中的新功能。
Read concern "snapshot"
is only available for multi-document transactions.
"majority"
, the transaction operations are guaranteed to have read from a snapshot of majority-committed data."majority"
, the transaction operations are guaranteed to have read from a snapshot of majority-committed data that provides causal consistency with the operation immediately preceding the transaction start.For a list of all operations that accept read concerns, see Operations That Support Read Concern.
Multi-document transactions support read concern "snapshot"
as well as "local"
, and "majority"
.
Note
You set the read concern at the transaction level, not at the individual operation level. To set the read concern for transactions, see Transactions and Read Concern.
For transactions on a sharded cluster, if any operation in the transaction involves a shard that has disabled read concern “majority”, you cannot use read concern "snapshot"
for the transaction. You can only use read concern "local"
or "majority"
for the transaction. If you use read concern "snapshot"
, the transaction errors and aborts. For more information, see Disabled Read Concern Majority.