- Reference >
mongosh
Methods >- Connection Methods >
- Mongo.setCausalConsistency()
Mongo.setCausalConsistency()¶
On this page
Definition¶
-
Mongo.
setCausalConsistency
(<boolean>)¶ Enables or disables causal consistency on the connection object. Causal consistency is disabled on the connection object by default.
Note
The
Mongo
connection object may have causal consistency disabled even though sessions may have causal consistency enabled or vice versa. SeeMongo.startSession()
.To enable causal consistency for the connection object, call the method without any argument:
The method also can accept a boolean argument:
true
to enable causal consistency:false
to disable causal consistency: