New in version 3.6.
Enables or disables causal consistency on the connection object. Causal consistency is disabled on the connection object by default.
To enable causal consistency for the connection object, call the method without any argument:
var conn = Mongo("localhost:27017"); conn.setCausalConsistency();
The method also can accept a boolean argument:
trueto enable causal consistency:
falseto disable causal consistency:
To check if causal consistency is enabled for a connection, use the
Mongo.isCausalConsistency() method. For example: