Debian Codegraph @

testdata/transactions/legacy/findOneAndReplace.yml

raw symbols SCIP
1 runOn:
2 -
3 minServerVersion: "4.0"
4 topology: ["replicaset"]
5 -
6 minServerVersion: "4.1.8"
7 topology: ["sharded"]
8
9 database_name: &database_name "transaction-tests"
10 collection_name: &collection_name "test"
11
12 data:
13 - _id: 1
14 - _id: 2
15 - _id: 3
16
17 tests:
18 - description: findOneAndReplace
19
20 operations:
21 - name: startTransaction
22 object: session0
23 - name: findOneAndReplace
24 object: collection
25 arguments:
26 session: session0
27 filter: {_id: 3}
28 replacement: {x: 1}
29 returnDocument: Before
30 result: {_id: 3}
31 - name: findOneAndReplace
32 object: collection
33 arguments:
34 session: session0
35 filter: {_id: 4}
36 replacement: {x: 1}
37 upsert: true
38 returnDocument: After
39 result: {_id: 4, x: 1}
40 - name: commitTransaction
41 object: session0
42
43 expectations:
44 - command_started_event:
45 command:
46 findAndModify: *collection_name
47 query: {_id: 3}
48 update: {x: 1}
49 new: false
50 lsid: session0
51 txnNumber:
52 $numberLong: "1"
53 startTransaction: true
54 autocommit: false
55 readConcern:
56 writeConcern:
57 command_name: findAndModify
58 database_name: *database_name
59 - command_started_event:
60 command:
61 findAndModify: *collection_name
62 query: {_id: 4}
63 update: {x: 1}
64 new: true
65 upsert: true
66 lsid: session0
67 txnNumber:
68 $numberLong: "1"
69 startTransaction:
70 autocommit: false
71 readConcern:
72 writeConcern:
73 command_name: findAndModify
74 database_name: *database_name
75 - command_started_event:
76 command:
77 commitTransaction: 1
78 lsid: session0
79 txnNumber:
80 $numberLong: "1"
81 startTransaction:
82 autocommit: false
83 readConcern:
84 writeConcern:
85 command_name: commitTransaction
86 database_name: admin
87
88 outcome:
89 collection:
90 data:
91 - {_id: 1}
92 - {_id: 2}
93 - {_id: 3, x: 1}
94 - {_id: 4, x: 1}
95
96 - description: collection writeConcern ignored for findOneAndReplace
97
98 operations:
99 - name: startTransaction
100 object: session0
101 arguments:
102 options:
103 writeConcern:
104 w: majority
105 - name: findOneAndReplace
106 object: collection
107 collectionOptions:
108 writeConcern:
109 w: majority
110 arguments:
111 session: session0
112 filter: {_id: 3}
113 replacement: {x: 1}
114 returnDocument: Before
115 result: {_id: 3}
116 - name: commitTransaction
117 object: session0
118
119 expectations:
120 - command_started_event:
121 command:
122 findAndModify: *collection_name
123 query: {_id: 3}
124 update: {x: 1}
125 new: false
126 lsid: session0
127 txnNumber:
128 $numberLong: "1"
129 startTransaction: true
130 autocommit: false
131 readConcern:
132 writeConcern:
133 command_name: findAndModify
134 database_name: *database_name
135 - command_started_event:
136 command:
137 commitTransaction: 1
138 lsid: session0
139 txnNumber:
140 $numberLong: "1"
141 startTransaction:
142 autocommit: false
143 readConcern:
144 writeConcern:
145 w: majority
146 command_name: commitTransaction
147 database_name: admin
148