Debian Codegraph @

testdata/transactions/legacy/insert.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 "tests": [
20 {
21 "description": "insert",
22 "operations": [
23 {
24 "name": "startTransaction",
25 "object": "session0"
26 },
27 {
28 "name": "insertOne",
29 "object": "collection",
30 "arguments": {
31 "session": "session0",
32 "document": {
33 "_id": 1
34 }
35 },
36 "result": {
37 "insertedId": 1
38 }
39 },
40 {
41 "name": "insertMany",
42 "object": "collection",
43 "arguments": {
44 "documents": [
45 {
46 "_id": 2
47 },
48 {
49 "_id": 3
50 }
51 ],
52 "session": "session0"
53 },
54 "result": {
55 "insertedIds": {
56 "0": 2,
57 "1": 3
58 }
59 }
60 },
61 {
62 "name": "insertOne",
63 "object": "collection",
64 "arguments": {
65 "session": "session0",
66 "document": {
67 "_id": 4
68 }
69 },
70 "result": {
71 "insertedId": 4
72 }
73 },
74 {
75 "name": "commitTransaction",
76 "object": "session0"
77 },
78 {
79 "name": "startTransaction",
80 "object": "session0"
81 },
82 {
83 "name": "insertOne",
84 "object": "collection",
85 "arguments": {
86 "session": "session0",
87 "document": {
88 "_id": 5
89 }
90 },
91 "result": {
92 "insertedId": 5
93 }
94 },
95 {
96 "name": "commitTransaction",
97 "object": "session0"
98 }
99 ],
100 "expectations": [
101 {
102 "command_started_event": {
103 "command": {
104 "insert": "test",
105 "documents": [
106 {
107 "_id": 1
108 }
109 ],
110 "ordered": true,
111 "readConcern": null,
112 "lsid": "session0",
113 "txnNumber": {
114 "$numberLong": "1"
115 },
116 "startTransaction": true,
117 "autocommit": false,
118 "writeConcern": null
119 },
120 "command_name": "insert",
121 "database_name": "transaction-tests"
122 }
123 },
124 {
125 "command_started_event": {
126 "command": {
127 "insert": "test",
128 "documents": [
129 {
130 "_id": 2
131 },
132 {
133 "_id": 3
134 }
135 ],
136 "ordered": true,
137 "lsid": "session0",
138 "txnNumber": {
139 "$numberLong": "1"
140 },
141 "startTransaction": null,
142 "autocommit": false,
143 "writeConcern": null
144 },
145 "command_name": "insert",
146 "database_name": "transaction-tests"
147 }
148 },
149 {
150 "command_started_event": {
151 "command": {
152 "insert": "test",
153 "documents": [
154 {
155 "_id": 4
156 }
157 ],
158 "ordered": true,
159 "lsid": "session0",
160 "txnNumber": {
161 "$numberLong": "1"
162 },
163 "autocommit": false,
164 "writeConcern": null
165 },
166 "command_name": "insert",
167 "database_name": "transaction-tests"
168 }
169 },
170 {
171 "command_started_event": {
172 "command": {
173 "commitTransaction": 1,
174 "lsid": "session0",
175 "txnNumber": {
176 "$numberLong": "1"
177 },
178 "startTransaction": null,
179 "autocommit": false,
180 "writeConcern": null
181 },
182 "command_name": "commitTransaction",
183 "database_name": "admin"
184 }
185 },
186 {
187 "command_started_event": {
188 "command": {
189 "insert": "test",
190 "documents": [
191 {
192 "_id": 5
193 }
194 ],
195 "ordered": true,
196 "readConcern": {
197 "afterClusterTime": 42
198 },
199 "lsid": "session0",
200 "txnNumber": {
201 "$numberLong": "2"
202 },
203 "startTransaction": true,
204 "autocommit": false,
205 "writeConcern": null
206 },
207 "command_name": "insert",
208 "database_name": "transaction-tests"
209 }
210 },
211 {
212 "command_started_event": {
213 "command": {
214 "commitTransaction": 1,
215 "lsid": "session0",
216 "txnNumber": {
217 "$numberLong": "2"
218 },
219 "startTransaction": null,
220 "autocommit": false,
221 "writeConcern": null
222 },
223 "command_name": "commitTransaction",
224 "database_name": "admin"
225 }
226 }
227 ],
228 "outcome": {
229 "collection": {
230 "data": [
231 {
232 "_id": 1
233 },
234 {
235 "_id": 2
236 },
237 {
238 "_id": 3
239 },
240 {
241 "_id": 4
242 },
243 {
244 "_id": 5
245 }
246 ]
247 }
248 }
249 },
250 {
251 "description": "insert with session1",
252 "operations": [
253 {
254 "name": "startTransaction",
255 "object": "session1"
256 },
257 {
258 "name": "insertOne",
259 "object": "collection",
260 "arguments": {
261 "session": "session1",
262 "document": {
263 "_id": 1
264 }
265 },
266 "result": {
267 "insertedId": 1
268 }
269 },
270 {
271 "name": "insertMany",
272 "object": "collection",
273 "arguments": {
274 "documents": [
275 {
276 "_id": 2
277 },
278 {
279 "_id": 3
280 }
281 ],
282 "session": "session1"
283 },
284 "result": {
285 "insertedIds": {
286 "0": 2,
287 "1": 3
288 }
289 }
290 },
291 {
292 "name": "commitTransaction",
293 "object": "session1"
294 },
295 {
296 "name": "startTransaction",
297 "object": "session1"
298 },
299 {
300 "name": "insertOne",
301 "object": "collection",
302 "arguments": {
303 "session": "session1",
304 "document": {
305 "_id": 4
306 }
307 },
308 "result": {
309 "insertedId": 4
310 }
311 },
312 {
313 "name": "abortTransaction",
314 "object": "session1"
315 }
316 ],
317 "expectations": [
318 {
319 "command_started_event": {
320 "command": {
321 "insert": "test",
322 "documents": [
323 {
324 "_id": 1
325 }
326 ],
327 "ordered": true,
328 "readConcern": null,
329 "lsid": "session1",
330 "txnNumber": {
331 "$numberLong": "1"
332 },
333 "startTransaction": true,
334 "autocommit": false,
335 "writeConcern": null
336 },
337 "command_name": "insert",
338 "database_name": "transaction-tests"
339 }
340 },
341 {
342 "command_started_event": {
343 "command": {
344 "insert": "test",
345 "documents": [
346 {
347 "_id": 2
348 },
349 {
350 "_id": 3
351 }
352 ],
353 "ordered": true,
354 "lsid": "session1",
355 "txnNumber": {
356 "$numberLong": "1"
357 },
358 "startTransaction": null,
359 "autocommit": false,
360 "writeConcern": null
361 },
362 "command_name": "insert",
363 "database_name": "transaction-tests"
364 }
365 },
366 {
367 "command_started_event": {
368 "command": {
369 "commitTransaction": 1,
370 "lsid": "session1",
371 "txnNumber": {
372 "$numberLong": "1"
373 },
374 "startTransaction": null,
375 "autocommit": false,
376 "writeConcern": null
377 },
378 "command_name": "commitTransaction",
379 "database_name": "admin"
380 }
381 },
382 {
383 "command_started_event": {
384 "command": {
385 "insert": "test",
386 "documents": [
387 {
388 "_id": 4
389 }
390 ],
391 "ordered": true,
392 "readConcern": {
393 "afterClusterTime": 42
394 },
395 "lsid": "session1",
396 "txnNumber": {
397 "$numberLong": "2"
398 },
399 "startTransaction": true,
400 "autocommit": false,
401 "writeConcern": null
402 },
403 "command_name": "insert",
404 "database_name": "transaction-tests"
405 }
406 },
407 {
408 "command_started_event": {
409 "command": {
410 "abortTransaction": 1,
411 "lsid": "session1",
412 "txnNumber": {
413 "$numberLong": "2"
414 },
415 "startTransaction": null,
416 "autocommit": false,
417 "writeConcern": null
418 },
419 "command_name": "abortTransaction",
420 "database_name": "admin"
421 }
422 }
423 ],
424 "outcome": {
425 "collection": {
426 "data": [
427 {
428 "_id": 1
429 },
430 {
431 "_id": 2
432 },
433 {
434 "_id": 3
435 }
436 ]
437 }
438 }
439 },
440 {
441 "description": "collection writeConcern without transaction",
442 "clientOptions": {
443 "retryWrites": false
444 },
445 "operations": [
446 {
447 "name": "insertOne",
448 "object": "collection",
449 "collectionOptions": {
450 "writeConcern": {
451 "w": "majority"
452 }
453 },
454 "arguments": {
455 "session": "session0",
456 "document": {
457 "_id": 1
458 }
459 },
460 "result": {
461 "insertedId": 1
462 }
463 }
464 ],
465 "expectations": [
466 {
467 "command_started_event": {
468 "command": {
469 "insert": "test",
470 "documents": [
471 {
472 "_id": 1
473 }
474 ],
475 "ordered": true,
476 "readConcern": null,
477 "lsid": "session0",
478 "txnNumber": null,
479 "startTransaction": null,
480 "autocommit": null,
481 "writeConcern": {
482 "w": "majority"
483 }
484 },
485 "command_name": "insert",
486 "database_name": "transaction-tests"
487 }
488 }
489 ],
490 "outcome": {
491 "collection": {
492 "data": [
493 {
494 "_id": 1
495 }
496 ]
497 }
498 }
499 },
500 {
501 "description": "collection writeConcern ignored for insert",
502 "operations": [
503 {
504 "name": "startTransaction",
505 "object": "session0",
506 "arguments": {
507 "options": {
508 "writeConcern": {
509 "w": "majority"
510 }
511 }
512 }
513 },
514 {
515 "name": "insertOne",
516 "object": "collection",
517 "collectionOptions": {
518 "writeConcern": {
519 "w": "majority"
520 }
521 },
522 "arguments": {
523 "session": "session0",
524 "document": {
525 "_id": 1
526 }
527 },
528 "result": {
529 "insertedId": 1
530 }
531 },
532 {
533 "name": "insertMany",
534 "object": "collection",
535 "collectionOptions": {
536 "writeConcern": {
537 "w": "majority"
538 }
539 },
540 "arguments": {
541 "documents": [
542 {
543 "_id": 2
544 },
545 {
546 "_id": 3
547 }
548 ],
549 "session": "session0"
550 },
551 "result": {
552 "insertedIds": {
553 "0": 2,
554 "1": 3
555 }
556 }
557 },
558 {
559 "name": "commitTransaction",
560 "object": "session0"
561 }
562 ],
563 "expectations": [
564 {
565 "command_started_event": {
566 "command": {
567 "insert": "test",
568 "documents": [
569 {
570 "_id": 1
571 }
572 ],
573 "ordered": true,
574 "readConcern": null,
575 "lsid": "session0",
576 "txnNumber": {
577 "$numberLong": "1"
578 },
579 "startTransaction": true,
580 "autocommit": false,
581 "writeConcern": null
582 },
583 "command_name": "insert",
584 "database_name": "transaction-tests"
585 }
586 },
587 {
588 "command_started_event": {
589 "command": {
590 "insert": "test",
591 "documents": [
592 {
593 "_id": 2
594 },
595 {
596 "_id": 3
597 }
598 ],
599 "ordered": true,
600 "lsid": "session0",
601 "txnNumber": {
602 "$numberLong": "1"
603 },
604 "startTransaction": null,
605 "autocommit": false,
606 "writeConcern": null
607 },
608 "command_name": "insert",
609 "database_name": "transaction-tests"
610 }
611 },
612 {
613 "command_started_event": {
614 "command": {
615 "commitTransaction": 1,
616 "lsid": "session0",
617 "txnNumber": {
618 "$numberLong": "1"
619 },
620 "startTransaction": null,
621 "autocommit": false,
622 "writeConcern": {
623 "w": "majority"
624 }
625 },
626 "command_name": "commitTransaction",
627 "database_name": "admin"
628 }
629 }
630 ],
631 "outcome": {
632 "collection": {
633 "data": [
634 {
635 "_id": 1
636 },
637 {
638 "_id": 2
639 },
640 {
641 "_id": 3
642 }
643 ]
644 }
645 }
646 }
647 ]
648 }