Debian Codegraph @

testdata/transactions/legacy/findOneAndUpdate.json

raw symbols SCIP
1 {
2 "runOn": [
3 {
4 "minServerVersion": "4.0",
5 "topology": [
6 "replicaset"
7 ]
8 },
9 {
10 "minServerVersion": "4.1.8",
11 "topology": [
12 "sharded"
13 ]
14 }
15 ],
16 "database_name": "transaction-tests",
17 "collection_name": "test",
18 "data": [
19 {
20 "_id": 1
21 },
22 {
23 "_id": 2
24 },
25 {
26 "_id": 3
27 }
28 ],
29 "tests": [
30 {
31 "description": "findOneAndUpdate",
32 "operations": [
33 {
34 "name": "startTransaction",
35 "object": "session0"
36 },
37 {
38 "name": "findOneAndUpdate",
39 "object": "collection",
40 "arguments": {
41 "session": "session0",
42 "filter": {
43 "_id": 3
44 },
45 "update": {
46 "$inc": {
47 "x": 1
48 }
49 },
50 "returnDocument": "Before"
51 },
52 "result": {
53 "_id": 3
54 }
55 },
56 {
57 "name": "findOneAndUpdate",
58 "object": "collection",
59 "arguments": {
60 "session": "session0",
61 "filter": {
62 "_id": 4
63 },
64 "update": {
65 "$inc": {
66 "x": 1
67 }
68 },
69 "upsert": true,
70 "returnDocument": "After"
71 },
72 "result": {
73 "_id": 4,
74 "x": 1
75 }
76 },
77 {
78 "name": "commitTransaction",
79 "object": "session0"
80 },
81 {
82 "name": "startTransaction",
83 "object": "session0"
84 },
85 {
86 "name": "findOneAndUpdate",
87 "object": "collection",
88 "arguments": {
89 "session": "session0",
90 "filter": {
91 "_id": 3
92 },
93 "update": {
94 "$inc": {
95 "x": 1
96 }
97 },
98 "returnDocument": "Before"
99 },
100 "result": {
101 "_id": 3,
102 "x": 1
103 }
104 },
105 {
106 "name": "commitTransaction",
107 "object": "session0"
108 },
109 {
110 "name": "startTransaction",
111 "object": "session0"
112 },
113 {
114 "name": "findOneAndUpdate",
115 "object": "collection",
116 "arguments": {
117 "session": "session0",
118 "filter": {
119 "_id": 3
120 },
121 "update": {
122 "$inc": {
123 "x": 1
124 }
125 },
126 "returnDocument": "Before"
127 },
128 "result": {
129 "_id": 3,
130 "x": 2
131 }
132 },
133 {
134 "name": "abortTransaction",
135 "object": "session0"
136 }
137 ],
138 "expectations": [
139 {
140 "command_started_event": {
141 "command": {
142 "findAndModify": "test",
143 "query": {
144 "_id": 3
145 },
146 "update": {
147 "$inc": {
148 "x": 1
149 }
150 },
151 "new": false,
152 "lsid": "session0",
153 "txnNumber": {
154 "$numberLong": "1"
155 },
156 "startTransaction": true,
157 "autocommit": false,
158 "readConcern": null,
159 "writeConcern": null
160 },
161 "command_name": "findAndModify",
162 "database_name": "transaction-tests"
163 }
164 },
165 {
166 "command_started_event": {
167 "command": {
168 "findAndModify": "test",
169 "query": {
170 "_id": 4
171 },
172 "update": {
173 "$inc": {
174 "x": 1
175 }
176 },
177 "new": true,
178 "upsert": true,
179 "lsid": "session0",
180 "txnNumber": {
181 "$numberLong": "1"
182 },
183 "startTransaction": null,
184 "autocommit": false,
185 "readConcern": null,
186 "writeConcern": null
187 },
188 "command_name": "findAndModify",
189 "database_name": "transaction-tests"
190 }
191 },
192 {
193 "command_started_event": {
194 "command": {
195 "commitTransaction": 1,
196 "lsid": "session0",
197 "txnNumber": {
198 "$numberLong": "1"
199 },
200 "startTransaction": null,
201 "autocommit": false,
202 "readConcern": null,
203 "writeConcern": null
204 },
205 "command_name": "commitTransaction",
206 "database_name": "admin"
207 }
208 },
209 {
210 "command_started_event": {
211 "command": {
212 "findAndModify": "test",
213 "query": {
214 "_id": 3
215 },
216 "update": {
217 "$inc": {
218 "x": 1
219 }
220 },
221 "new": false,
222 "lsid": "session0",
223 "txnNumber": {
224 "$numberLong": "2"
225 },
226 "startTransaction": true,
227 "autocommit": false,
228 "readConcern": {
229 "afterClusterTime": 42
230 },
231 "writeConcern": null
232 },
233 "command_name": "findAndModify",
234 "database_name": "transaction-tests"
235 }
236 },
237 {
238 "command_started_event": {
239 "command": {
240 "commitTransaction": 1,
241 "lsid": "session0",
242 "txnNumber": {
243 "$numberLong": "2"
244 },
245 "startTransaction": null,
246 "autocommit": false,
247 "readConcern": null,
248 "writeConcern": null
249 },
250 "command_name": "commitTransaction",
251 "database_name": "admin"
252 }
253 },
254 {
255 "command_started_event": {
256 "command": {
257 "findAndModify": "test",
258 "query": {
259 "_id": 3
260 },
261 "update": {
262 "$inc": {
263 "x": 1
264 }
265 },
266 "new": false,
267 "lsid": "session0",
268 "txnNumber": {
269 "$numberLong": "3"
270 },
271 "startTransaction": true,
272 "autocommit": false,
273 "readConcern": {
274 "afterClusterTime": 42
275 },
276 "writeConcern": null
277 },
278 "command_name": "findAndModify",
279 "database_name": "transaction-tests"
280 }
281 },
282 {
283 "command_started_event": {
284 "command": {
285 "abortTransaction": 1,
286 "lsid": "session0",
287 "txnNumber": {
288 "$numberLong": "3"
289 },
290 "startTransaction": null,
291 "autocommit": false,
292 "readConcern": null,
293 "writeConcern": null
294 },
295 "command_name": "abortTransaction",
296 "database_name": "admin"
297 }
298 }
299 ],
300 "outcome": {
301 "collection": {
302 "data": [
303 {
304 "_id": 1
305 },
306 {
307 "_id": 2
308 },
309 {
310 "_id": 3,
311 "x": 2
312 },
313 {
314 "_id": 4,
315 "x": 1
316 }
317 ]
318 }
319 }
320 },
321 {
322 "description": "collection writeConcern ignored for findOneAndUpdate",
323 "operations": [
324 {
325 "name": "startTransaction",
326 "object": "session0",
327 "arguments": {
328 "options": {
329 "writeConcern": {
330 "w": "majority"
331 }
332 }
333 }
334 },
335 {
336 "name": "findOneAndUpdate",
337 "object": "collection",
338 "collectionOptions": {
339 "writeConcern": {
340 "w": "majority"
341 }
342 },
343 "arguments": {
344 "session": "session0",
345 "filter": {
346 "_id": 3
347 },
348 "update": {
349 "$inc": {
350 "x": 1
351 }
352 },
353 "returnDocument": "Before"
354 },
355 "result": {
356 "_id": 3
357 }
358 },
359 {
360 "name": "commitTransaction",
361 "object": "session0"
362 }
363 ],
364 "expectations": [
365 {
366 "command_started_event": {
367 "command": {
368 "findAndModify": "test",
369 "query": {
370 "_id": 3
371 },
372 "update": {
373 "$inc": {
374 "x": 1
375 }
376 },
377 "new": false,
378 "lsid": "session0",
379 "txnNumber": {
380 "$numberLong": "1"
381 },
382 "startTransaction": true,
383 "autocommit": false,
384 "readConcern": null,
385 "writeConcern": null
386 },
387 "command_name": "findAndModify",
388 "database_name": "transaction-tests"
389 }
390 },
391 {
392 "command_started_event": {
393 "command": {
394 "commitTransaction": 1,
395 "lsid": "session0",
396 "txnNumber": {
397 "$numberLong": "1"
398 },
399 "startTransaction": null,
400 "autocommit": false,
401 "readConcern": null,
402 "writeConcern": {
403 "w": "majority"
404 }
405 },
406 "command_name": "commitTransaction",
407 "database_name": "admin"
408 }
409 }
410 ]
411 }
412 ]
413 }