Mongo.causal_consistency
You're seeing just the function
causal_consistency
, go back to Mongo module for more information.
Convenient function to execute write and read operation with a causal consistency session.
With causally consistent sessions, MongoDB executes causal operations in an order that respect their causal relationships, and clients observe results that are consistent with the causal relationships.
Example
{:ok, 0} = Mongo.causal_consistency(top, fn ->
Mongo.delete_many(top, "dogs", %{name: "Greta"}, w: :majority)
Mongo.count(top, "dogs", %{name: "Greta"}, read_concern: %{level: :majority})
end)
The function creates a causal consistency session and stores it in the process dictionary under
the key :session
. But you need to specify the write and read concerns for each operation to
:majority