| 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": "bulk", |
| 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": "deleteOne", |
| 42 | "object": "collection", |
| 43 | "arguments": { |
| 44 | "session": "session0", |
| 45 | "filter": { |
| 46 | "_id": 1 |
| 47 | } |
| 48 | }, |
| 49 | "result": { |
| 50 | "deletedCount": 1 |
| 51 | } |
| 52 | }, |
| 53 | { |
| 54 | "name": "bulkWrite", |
| 55 | "object": "collection", |
| 56 | "arguments": { |
| 57 | "session": "session0", |
| 58 | "requests": [ |
| 59 | { |
| 60 | "name": "insertOne", |
| 61 | "arguments": { |
| 62 | "document": { |
| 63 | "_id": 1 |
| 64 | } |
| 65 | } |
| 66 | }, |
| 67 | { |
| 68 | "name": "updateOne", |
| 69 | "arguments": { |
| 70 | "filter": { |
| 71 | "_id": 1 |
| 72 | }, |
| 73 | "update": { |
| 74 | "$set": { |
| 75 | "x": 1 |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | }, |
| 80 | { |
| 81 | "name": "updateOne", |
| 82 | "arguments": { |
| 83 | "filter": { |
| 84 | "_id": 2 |
| 85 | }, |
| 86 | "update": { |
| 87 | "$set": { |
| 88 | "x": 2 |
| 89 | } |
| 90 | }, |
| 91 | "upsert": true |
| 92 | } |
| 93 | }, |
| 94 | { |
| 95 | "name": "insertOne", |
| 96 | "arguments": { |
| 97 | "document": { |
| 98 | "_id": 3 |
| 99 | } |
| 100 | } |
| 101 | }, |
| 102 | { |
| 103 | "name": "insertOne", |
| 104 | "arguments": { |
| 105 | "document": { |
| 106 | "_id": 4 |
| 107 | } |
| 108 | } |
| 109 | }, |
| 110 | { |
| 111 | "name": "insertOne", |
| 112 | "arguments": { |
| 113 | "document": { |
| 114 | "_id": 5 |
| 115 | } |
| 116 | } |
| 117 | }, |
| 118 | { |
| 119 | "name": "insertOne", |
| 120 | "arguments": { |
| 121 | "document": { |
| 122 | "_id": 6 |
| 123 | } |
| 124 | } |
| 125 | }, |
| 126 | { |
| 127 | "name": "insertOne", |
| 128 | "arguments": { |
| 129 | "document": { |
| 130 | "_id": 7 |
| 131 | } |
| 132 | } |
| 133 | }, |
| 134 | { |
| 135 | "name": "replaceOne", |
| 136 | "arguments": { |
| 137 | "filter": { |
| 138 | "_id": 1 |
| 139 | }, |
| 140 | "replacement": { |
| 141 | "y": 1 |
| 142 | } |
| 143 | } |
| 144 | }, |
| 145 | { |
| 146 | "name": "replaceOne", |
| 147 | "arguments": { |
| 148 | "filter": { |
| 149 | "_id": 2 |
| 150 | }, |
| 151 | "replacement": { |
| 152 | "y": 2 |
| 153 | } |
| 154 | } |
| 155 | }, |
| 156 | { |
| 157 | "name": "deleteOne", |
| 158 | "arguments": { |
| 159 | "filter": { |
| 160 | "_id": 3 |
| 161 | } |
| 162 | } |
| 163 | }, |
| 164 | { |
| 165 | "name": "deleteOne", |
| 166 | "arguments": { |
| 167 | "filter": { |
| 168 | "_id": 4 |
| 169 | } |
| 170 | } |
| 171 | }, |
| 172 | { |
| 173 | "name": "updateMany", |
| 174 | "arguments": { |
| 175 | "filter": { |
| 176 | "_id": { |
| 177 | "$gte": 2 |
| 178 | } |
| 179 | }, |
| 180 | "update": { |
| 181 | "$set": { |
| 182 | "z": 1 |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | }, |
| 187 | { |
| 188 | "name": "deleteMany", |
| 189 | "arguments": { |
| 190 | "filter": { |
| 191 | "_id": { |
| 192 | "$gte": 6 |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | } |
| 197 | ] |
| 198 | }, |
| 199 | "result": { |
| 200 | "deletedCount": 4, |
| 201 | "insertedCount": 6, |
| 202 | "insertedIds": { |
| 203 | "0": 1, |
| 204 | "3": 3, |
| 205 | "4": 4, |
| 206 | "5": 5, |
| 207 | "6": 6, |
| 208 | "7": 7 |
| 209 | }, |
| 210 | "matchedCount": 7, |
| 211 | "modifiedCount": 7, |
| 212 | "upsertedCount": 1, |
| 213 | "upsertedIds": { |
| 214 | "2": 2 |
| 215 | } |
| 216 | } |
| 217 | }, |
| 218 | { |
| 219 | "name": "commitTransaction", |
| 220 | "object": "session0" |
| 221 | } |
| 222 | ], |
| 223 | "expectations": [ |
| 224 | { |
| 225 | "command_started_event": { |
| 226 | "command": { |
| 227 | "insert": "test", |
| 228 | "documents": [ |
| 229 | { |
| 230 | "_id": 1 |
| 231 | } |
| 232 | ], |
| 233 | "ordered": true, |
| 234 | "readConcern": null, |
| 235 | "lsid": "session0", |
| 236 | "txnNumber": { |
| 237 | "$numberLong": "1" |
| 238 | }, |
| 239 | "startTransaction": true, |
| 240 | "autocommit": false, |
| 241 | "writeConcern": null |
| 242 | }, |
| 243 | "command_name": "insert", |
| 244 | "database_name": "transaction-tests" |
| 245 | } |
| 246 | }, |
| 247 | { |
| 248 | "command_started_event": { |
| 249 | "command": { |
| 250 | "delete": "test", |
| 251 | "deletes": [ |
| 252 | { |
| 253 | "q": { |
| 254 | "_id": 1 |
| 255 | }, |
| 256 | "limit": 1 |
| 257 | } |
| 258 | ], |
| 259 | "ordered": true, |
| 260 | "lsid": "session0", |
| 261 | "txnNumber": { |
| 262 | "$numberLong": "1" |
| 263 | }, |
| 264 | "startTransaction": null, |
| 265 | "autocommit": false, |
| 266 | "writeConcern": null |
| 267 | }, |
| 268 | "command_name": "delete", |
| 269 | "database_name": "transaction-tests" |
| 270 | } |
| 271 | }, |
| 272 | { |
| 273 | "command_started_event": { |
| 274 | "command": { |
| 275 | "insert": "test", |
| 276 | "documents": [ |
| 277 | { |
| 278 | "_id": 1 |
| 279 | } |
| 280 | ], |
| 281 | "ordered": true, |
| 282 | "lsid": "session0", |
| 283 | "txnNumber": { |
| 284 | "$numberLong": "1" |
| 285 | }, |
| 286 | "startTransaction": null, |
| 287 | "autocommit": false, |
| 288 | "writeConcern": null |
| 289 | }, |
| 290 | "command_name": "insert", |
| 291 | "database_name": "transaction-tests" |
| 292 | } |
| 293 | }, |
| 294 | { |
| 295 | "command_started_event": { |
| 296 | "command": { |
| 297 | "update": "test", |
| 298 | "updates": [ |
| 299 | { |
| 300 | "q": { |
| 301 | "_id": 1 |
| 302 | }, |
| 303 | "u": { |
| 304 | "$set": { |
| 305 | "x": 1 |
| 306 | } |
| 307 | } |
| 308 | }, |
| 309 | { |
| 310 | "q": { |
| 311 | "_id": 2 |
| 312 | }, |
| 313 | "u": { |
| 314 | "$set": { |
| 315 | "x": 2 |
| 316 | } |
| 317 | }, |
| 318 | "upsert": true |
| 319 | } |
| 320 | ], |
| 321 | "ordered": true, |
| 322 | "lsid": "session0", |
| 323 | "txnNumber": { |
| 324 | "$numberLong": "1" |
| 325 | }, |
| 326 | "startTransaction": null, |
| 327 | "autocommit": false, |
| 328 | "writeConcern": null |
| 329 | }, |
| 330 | "command_name": "update", |
| 331 | "database_name": "transaction-tests" |
| 332 | } |
| 333 | }, |
| 334 | { |
| 335 | "command_started_event": { |
| 336 | "command": { |
| 337 | "insert": "test", |
| 338 | "documents": [ |
| 339 | { |
| 340 | "_id": 3 |
| 341 | }, |
| 342 | { |
| 343 | "_id": 4 |
| 344 | }, |
| 345 | { |
| 346 | "_id": 5 |
| 347 | }, |
| 348 | { |
| 349 | "_id": 6 |
| 350 | }, |
| 351 | { |
| 352 | "_id": 7 |
| 353 | } |
| 354 | ], |
| 355 | "ordered": true, |
| 356 | "lsid": "session0", |
| 357 | "txnNumber": { |
| 358 | "$numberLong": "1" |
| 359 | }, |
| 360 | "startTransaction": null, |
| 361 | "autocommit": false, |
| 362 | "writeConcern": null |
| 363 | }, |
| 364 | "command_name": "insert", |
| 365 | "database_name": "transaction-tests" |
| 366 | } |
| 367 | }, |
| 368 | { |
| 369 | "command_started_event": { |
| 370 | "command": { |
| 371 | "update": "test", |
| 372 | "updates": [ |
| 373 | { |
| 374 | "q": { |
| 375 | "_id": 1 |
| 376 | }, |
| 377 | "u": { |
| 378 | "y": 1 |
| 379 | } |
| 380 | }, |
| 381 | { |
| 382 | "q": { |
| 383 | "_id": 2 |
| 384 | }, |
| 385 | "u": { |
| 386 | "y": 2 |
| 387 | } |
| 388 | } |
| 389 | ], |
| 390 | "ordered": true, |
| 391 | "lsid": "session0", |
| 392 | "txnNumber": { |
| 393 | "$numberLong": "1" |
| 394 | }, |
| 395 | "startTransaction": null, |
| 396 | "autocommit": false, |
| 397 | "writeConcern": null |
| 398 | }, |
| 399 | "command_name": "update", |
| 400 | "database_name": "transaction-tests" |
| 401 | } |
| 402 | }, |
| 403 | { |
| 404 | "command_started_event": { |
| 405 | "command": { |
| 406 | "delete": "test", |
| 407 | "deletes": [ |
| 408 | { |
| 409 | "q": { |
| 410 | "_id": 3 |
| 411 | }, |
| 412 | "limit": 1 |
| 413 | }, |
| 414 | { |
| 415 | "q": { |
| 416 | "_id": 4 |
| 417 | }, |
| 418 | "limit": 1 |
| 419 | } |
| 420 | ], |
| 421 | "ordered": true, |
| 422 | "lsid": "session0", |
| 423 | "txnNumber": { |
| 424 | "$numberLong": "1" |
| 425 | }, |
| 426 | "startTransaction": null, |
| 427 | "autocommit": false, |
| 428 | "writeConcern": null |
| 429 | }, |
| 430 | "command_name": "delete", |
| 431 | "database_name": "transaction-tests" |
| 432 | } |
| 433 | }, |
| 434 | { |
| 435 | "command_started_event": { |
| 436 | "command": { |
| 437 | "update": "test", |
| 438 | "updates": [ |
| 439 | { |
| 440 | "q": { |
| 441 | "_id": { |
| 442 | "$gte": 2 |
| 443 | } |
| 444 | }, |
| 445 | "u": { |
| 446 | "$set": { |
| 447 | "z": 1 |
| 448 | } |
| 449 | }, |
| 450 | "multi": true |
| 451 | } |
| 452 | ], |
| 453 | "ordered": true, |
| 454 | "lsid": "session0", |
| 455 | "txnNumber": { |
| 456 | "$numberLong": "1" |
| 457 | }, |
| 458 | "startTransaction": null, |
| 459 | "autocommit": false, |
| 460 | "writeConcern": null |
| 461 | }, |
| 462 | "command_name": "update", |
| 463 | "database_name": "transaction-tests" |
| 464 | } |
| 465 | }, |
| 466 | { |
| 467 | "command_started_event": { |
| 468 | "command": { |
| 469 | "delete": "test", |
| 470 | "deletes": [ |
| 471 | { |
| 472 | "q": { |
| 473 | "_id": { |
| 474 | "$gte": 6 |
| 475 | } |
| 476 | }, |
| 477 | "limit": 0 |
| 478 | } |
| 479 | ], |
| 480 | "ordered": true, |
| 481 | "lsid": "session0", |
| 482 | "txnNumber": { |
| 483 | "$numberLong": "1" |
| 484 | }, |
| 485 | "startTransaction": null, |
| 486 | "autocommit": false, |
| 487 | "writeConcern": null |
| 488 | }, |
| 489 | "command_name": "delete", |
| 490 | "database_name": "transaction-tests" |
| 491 | } |
| 492 | }, |
| 493 | { |
| 494 | "command_started_event": { |
| 495 | "command": { |
| 496 | "commitTransaction": 1, |
| 497 | "lsid": "session0", |
| 498 | "txnNumber": { |
| 499 | "$numberLong": "1" |
| 500 | }, |
| 501 | "startTransaction": null, |
| 502 | "autocommit": false, |
| 503 | "writeConcern": null |
| 504 | }, |
| 505 | "command_name": "commitTransaction", |
| 506 | "database_name": "admin" |
| 507 | } |
| 508 | } |
| 509 | ], |
| 510 | "outcome": { |
| 511 | "collection": { |
| 512 | "data": [ |
| 513 | { |
| 514 | "_id": 1, |
| 515 | "y": 1 |
| 516 | }, |
| 517 | { |
| 518 | "_id": 2, |
| 519 | "y": 2, |
| 520 | "z": 1 |
| 521 | }, |
| 522 | { |
| 523 | "_id": 5, |
| 524 | "z": 1 |
| 525 | } |
| 526 | ] |
| 527 | } |
| 528 | } |
| 529 | } |
| 530 | ] |
| 531 | } |