Debian Codegraph @

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