# Test snapshot isolation. # This test doesn't check contents of command-started events. database_name: &database_name "ruby-driver" collection_name: &collection_name "transactions-tests" data: [] tests: - description: one transaction operations: - name: startTransaction object: session0 - name: insertOne object: collection arguments: session: session0 document: _id: 1 result: insertedId: 1 - name: find object: collection arguments: session: session0 filter: _id: 1 result: - {_id: 1} - name: find object: collection arguments: session: session1 filter: _id: 1 result: [] - name: find object: collection arguments: filter: _id: 1 result: [] - name: commitTransaction object: session0 - name: find object: collection arguments: session: session1 filter: _id: 1 result: - {_id: 1} - name: find object: collection arguments: filter: _id: 1 result: - {_id: 1} outcome: collection: data: - _id: 1 - description: two transactions operations: - name: startTransaction object: session0 - name: startTransaction object: session1 - name: insertOne object: collection arguments: session: session0 document: _id: 1 result: insertedId: 1 - name: find object: collection arguments: session: session0 filter: _id: 1 result: - {_id: 1} - name: find object: collection arguments: session: session1 filter: _id: 1 result: [] - name: find object: collection arguments: filter: _id: 1 result: [] - name: commitTransaction object: session0 # Snapshot isolation in session1, not read-committed. - name: find object: collection arguments: session: session1 filter: _id: 1 result: [] - name: find object: collection arguments: filter: _id: 1 result: - {_id: 1} - name: commitTransaction object: session1 outcome: collection: data: - {_id: 1}