lib/mongo/operation/shared/sessions_supported.rb
# Adds causal consistency document to the selector, if one can be
# constructed.
#
# In order for the causal consistency document to be constructed,
# causal consistency must be enabled for the session and the session
# must have the current operation time. Also, topology must be
# replica set or sharded cluster.
Adds causal consistency document to the selector, if one can be
constructed.

In order for the causal consistency document to be constructed,
causal consistency must be enabled for the session and the session
must have the current operation time. Also, topology must be
replica set or sharded cluster.
Adds causal consistency document to the selector if one can be constructed . In order for the causal consistency document to be constructed causal consistency must be enabled for the session and the session must have the current operation time . Also topology must be replica set or sharded cluster .
def apply_causal_consistency_if_possible(selector, connection)
        if !connection.description.standalone?
          cc_doc = session.send(:causal_consistency_doc)
          if cc_doc
            rc_doc = (selector[:readConcern] || read_concern || {}).merge(cc_doc)
            selector[:readConcern] = Options::Mapper.transform_values_to_strings(
              rc_doc)
          end
        end
      end
def apply_causal_consistency_if_possible ( selector , connection ) if ! connection . description . standalone? cc_doc = session . send ( :causal_consistency_doc ) if cc_doc rc_doc = ( selector [ :readConcern ] || read_concern || { } ) . merge ( cc_doc ) selector [ :readConcern ] = Options :: Mapper . transform_values_to_strings ( rc_doc ) end end end
Adds causal consistency document to the selector, if one can be
constructed.
Adds causal consistency document to the selector if one can be constructed .
selector
<not_specific>
connection
<not_specific>