| 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 | "_id": 4 |
| 30 | }, |
| 31 | { |
| 32 | "_id": 5 |
| 33 | } |
| 34 | ], |
| 35 | "tests": [ |
| 36 | { |
| 37 | "description": "delete", |
| 38 | "operations": [ |
| 39 | { |
| 40 | "name": "startTransaction", |
| 41 | "object": "session0" |
| 42 | }, |
| 43 | { |
| 44 | "name": "deleteOne", |
| 45 | "object": "collection", |
| 46 | "arguments": { |
| 47 | "session": "session0", |
| 48 | "filter": { |
| 49 | "_id": 1 |
| 50 | } |
| 51 | }, |
| 52 | "result": { |
| 53 | "deletedCount": 1 |
| 54 | } |
| 55 | }, |
| 56 | { |
| 57 | "name": "deleteMany", |
| 58 | "object": "collection", |
| 59 | "arguments": { |
| 60 | "session": "session0", |
| 61 | "filter": { |
| 62 | "_id": { |
| 63 | "$lte": 3 |
| 64 | } |
| 65 | } |
| 66 | }, |
| 67 | "result": { |
| 68 | "deletedCount": 2 |
| 69 | } |
| 70 | }, |
| 71 | { |
| 72 | "name": "deleteOne", |
| 73 | "object": "collection", |
| 74 | "arguments": { |
| 75 | "session": "session0", |
| 76 | "filter": { |
| 77 | "_id": 4 |
| 78 | } |
| 79 | }, |
| 80 | "result": { |
| 81 | "deletedCount": 1 |
| 82 | } |
| 83 | }, |
| 84 | { |
| 85 | "name": "commitTransaction", |
| 86 | "object": "session0" |
| 87 | } |
| 88 | ], |
| 89 | "expectations": [ |
| 90 | { |
| 91 | "command_started_event": { |
| 92 | "command": { |
| 93 | "delete": "test", |
| 94 | "deletes": [ |
| 95 | { |
| 96 | "q": { |
| 97 | "_id": 1 |
| 98 | }, |
| 99 | "limit": 1 |
| 100 | } |
| 101 | ], |
| 102 | "ordered": true, |
| 103 | "readConcern": null, |
| 104 | "lsid": "session0", |
| 105 | "txnNumber": { |
| 106 | "$numberLong": "1" |
| 107 | }, |
| 108 | "startTransaction": true, |
| 109 | "autocommit": false, |
| 110 | "writeConcern": null |
| 111 | }, |
| 112 | "command_name": "delete", |
| 113 | "database_name": "transaction-tests" |
| 114 | } |
| 115 | }, |
| 116 | { |
| 117 | "command_started_event": { |
| 118 | "command": { |
| 119 | "delete": "test", |
| 120 | "deletes": [ |
| 121 | { |
| 122 | "q": { |
| 123 | "_id": { |
| 124 | "$lte": 3 |
| 125 | } |
| 126 | }, |
| 127 | "limit": 0 |
| 128 | } |
| 129 | ], |
| 130 | "ordered": true, |
| 131 | "lsid": "session0", |
| 132 | "txnNumber": { |
| 133 | "$numberLong": "1" |
| 134 | }, |
| 135 | "startTransaction": null, |
| 136 | "autocommit": false, |
| 137 | "writeConcern": null |
| 138 | }, |
| 139 | "command_name": "delete", |
| 140 | "database_name": "transaction-tests" |
| 141 | } |
| 142 | }, |
| 143 | { |
| 144 | "command_started_event": { |
| 145 | "command": { |
| 146 | "delete": "test", |
| 147 | "deletes": [ |
| 148 | { |
| 149 | "q": { |
| 150 | "_id": 4 |
| 151 | }, |
| 152 | "limit": 1 |
| 153 | } |
| 154 | ], |
| 155 | "ordered": true, |
| 156 | "lsid": "session0", |
| 157 | "txnNumber": { |
| 158 | "$numberLong": "1" |
| 159 | }, |
| 160 | "startTransaction": null, |
| 161 | "autocommit": false, |
| 162 | "writeConcern": null |
| 163 | }, |
| 164 | "command_name": "delete", |
| 165 | "database_name": "transaction-tests" |
| 166 | } |
| 167 | }, |
| 168 | { |
| 169 | "command_started_event": { |
| 170 | "command": { |
| 171 | "commitTransaction": 1, |
| 172 | "lsid": "session0", |
| 173 | "txnNumber": { |
| 174 | "$numberLong": "1" |
| 175 | }, |
| 176 | "startTransaction": null, |
| 177 | "autocommit": false, |
| 178 | "writeConcern": null |
| 179 | }, |
| 180 | "command_name": "commitTransaction", |
| 181 | "database_name": "admin" |
| 182 | } |
| 183 | } |
| 184 | ], |
| 185 | "outcome": { |
| 186 | "collection": { |
| 187 | "data": [ |
| 188 | { |
| 189 | "_id": 5 |
| 190 | } |
| 191 | ] |
| 192 | } |
| 193 | } |
| 194 | }, |
| 195 | { |
| 196 | "description": "collection writeConcern ignored for delete", |
| 197 | "operations": [ |
| 198 | { |
| 199 | "name": "startTransaction", |
| 200 | "object": "session0", |
| 201 | "arguments": { |
| 202 | "options": { |
| 203 | "writeConcern": { |
| 204 | "w": "majority" |
| 205 | } |
| 206 | } |
| 207 | } |
| 208 | }, |
| 209 | { |
| 210 | "name": "deleteOne", |
| 211 | "object": "collection", |
| 212 | "collectionOptions": { |
| 213 | "writeConcern": { |
| 214 | "w": "majority" |
| 215 | } |
| 216 | }, |
| 217 | "arguments": { |
| 218 | "session": "session0", |
| 219 | "filter": { |
| 220 | "_id": 1 |
| 221 | } |
| 222 | }, |
| 223 | "result": { |
| 224 | "deletedCount": 1 |
| 225 | } |
| 226 | }, |
| 227 | { |
| 228 | "name": "deleteMany", |
| 229 | "object": "collection", |
| 230 | "collectionOptions": { |
| 231 | "writeConcern": { |
| 232 | "w": "majority" |
| 233 | } |
| 234 | }, |
| 235 | "arguments": { |
| 236 | "session": "session0", |
| 237 | "filter": { |
| 238 | "_id": { |
| 239 | "$lte": 3 |
| 240 | } |
| 241 | } |
| 242 | }, |
| 243 | "result": { |
| 244 | "deletedCount": 2 |
| 245 | } |
| 246 | }, |
| 247 | { |
| 248 | "name": "commitTransaction", |
| 249 | "object": "session0" |
| 250 | } |
| 251 | ], |
| 252 | "expectations": [ |
| 253 | { |
| 254 | "command_started_event": { |
| 255 | "command": { |
| 256 | "delete": "test", |
| 257 | "deletes": [ |
| 258 | { |
| 259 | "q": { |
| 260 | "_id": 1 |
| 261 | }, |
| 262 | "limit": 1 |
| 263 | } |
| 264 | ], |
| 265 | "ordered": true, |
| 266 | "readConcern": null, |
| 267 | "lsid": "session0", |
| 268 | "txnNumber": { |
| 269 | "$numberLong": "1" |
| 270 | }, |
| 271 | "startTransaction": true, |
| 272 | "autocommit": false, |
| 273 | "writeConcern": null |
| 274 | }, |
| 275 | "command_name": "delete", |
| 276 | "database_name": "transaction-tests" |
| 277 | } |
| 278 | }, |
| 279 | { |
| 280 | "command_started_event": { |
| 281 | "command": { |
| 282 | "delete": "test", |
| 283 | "deletes": [ |
| 284 | { |
| 285 | "q": { |
| 286 | "_id": { |
| 287 | "$lte": 3 |
| 288 | } |
| 289 | }, |
| 290 | "limit": 0 |
| 291 | } |
| 292 | ], |
| 293 | "ordered": true, |
| 294 | "lsid": "session0", |
| 295 | "txnNumber": { |
| 296 | "$numberLong": "1" |
| 297 | }, |
| 298 | "startTransaction": null, |
| 299 | "autocommit": false, |
| 300 | "writeConcern": null |
| 301 | }, |
| 302 | "command_name": "delete", |
| 303 | "database_name": "transaction-tests" |
| 304 | } |
| 305 | }, |
| 306 | { |
| 307 | "command_started_event": { |
| 308 | "command": { |
| 309 | "commitTransaction": 1, |
| 310 | "lsid": "session0", |
| 311 | "txnNumber": { |
| 312 | "$numberLong": "1" |
| 313 | }, |
| 314 | "startTransaction": null, |
| 315 | "autocommit": false, |
| 316 | "writeConcern": { |
| 317 | "w": "majority" |
| 318 | } |
| 319 | }, |
| 320 | "command_name": "commitTransaction", |
| 321 | "database_name": "admin" |
| 322 | } |
| 323 | } |
| 324 | ] |
| 325 | } |
| 326 | ] |
| 327 | } |