@@ -41,10 +41,9 @@ be aware that if the application calls ``#start_session`` on a client and waits
4141the session, it risks getting errors due to the session going stale before it is used.
4242
4343
44-
4544Using a session
4645---------------
47- A session can be passed to most operations performed via the driver so that the operation can be executed in the
46+ A session object can be passed to most driver methods so that the operation can be executed in the
4847context of that session. Please see the API docs for which methods support a session argument.
4948
5049Create a session and execute an insert, then a find using that session:
@@ -53,9 +52,9 @@ Create a session and execute an insert, then a find using that session:
5352
5453 session = client.start_session
5554 client[:artists].insert_one({ :name => 'FKA Twigs' }, session: session)
56- client[:artists].find({ :name => 'FKA Twigs' }, session: session).first
55+ client[:artists].find({ :name => 'FKA Twigs' }, limit: 1, session: session).first
5756
58- If you like to call methods on a ``Mongo::Collection::View`` that use a particular session, you can create the
57+ If you like to call methods on a ``Mongo::Collection::View`` in the context of a particular session, you can create the
5958``Mongo::Collection::View`` with the session and then call methods on it:
6059
6160.. code-block:: ruby
@@ -89,14 +88,14 @@ To create a causally consistent session, set the ``causal_consistency`` option t
8988 collection.update_one({ '_id' => 1 }, { '$set' => { 'x' => 0 } }, session: session)
9089
9190 # Read your write, even when reading from a secondary!
92- collection.find({ '_id' => 1 }, limit: 1, session: session).first
91+ collection.find({ '_id' => 1 }, session: session).first
9392
9493 # This query returns data at least as new as the previous query,
9594 # even if it chooses a different secondary.
96- collection.find({ '_id' => 2 }, limit: 1, session: session).first
95+ collection.find({ '_id' => 2 }, session: session).first
9796
9897Since unacknowledged writes don't receive a response from the server (or don't wait for a response), the driver
99- has no way of keeping track of where the unacknowledged write is in logical time. Therefore, be aware that causally
98+ has no way of keeping track of where the unacknowledged write is in logical time. Therefore, causally
10099consistent reads are not causally consistent with unacknowledged writes.
101100
102101Note that if you set the causal_consistency option to nil as in ``(causal_consistency: nil)``, it will be interpreted
0 commit comments