File tree Expand file tree Collapse file tree 4 files changed +78
-63
lines changed
driver-core/src/test/resources/transactions Expand file tree Collapse file tree 4 files changed +78
-63
lines changed Original file line number Diff line number Diff line change 40
40
}
41
41
},
42
42
{
43
- "name" : " count " ,
43
+ "name" : " aggregate " ,
44
44
"object" : " collection" ,
45
45
"collectionOptions" : {
46
46
"readPreference" : {
49
49
},
50
50
"arguments" : {
51
51
"session" : " session0" ,
52
- "filter" : {
53
- "_id" : 1
54
- }
52
+ "pipeline" : [
53
+ {
54
+ "$match" : {
55
+ "_id" : 1
56
+ }
57
+ },
58
+ {
59
+ "$count" : " count"
60
+ }
61
+ ]
55
62
},
56
- "result" : 1
63
+ "result" : [
64
+ {
65
+ "count" : 1
66
+ }
67
+ ]
57
68
},
58
69
{
59
70
"name" : " find" ,
184
195
}
185
196
},
186
197
{
187
- "name" : " count " ,
198
+ "name" : " aggregate " ,
188
199
"object" : " collection" ,
189
200
"collectionOptions" : {
190
201
"readPreference" : {
193
204
},
194
205
"arguments" : {
195
206
"session" : " session0" ,
196
- "filter" : {
197
- "_id" : 1
198
- }
207
+ "pipeline" : [
208
+ {
209
+ "$match" : {
210
+ "_id" : 1
211
+ }
212
+ },
213
+ {
214
+ "$count" : " count"
215
+ }
216
+ ]
199
217
},
200
- "result" : 1
218
+ "result" : [
219
+ {
220
+ "count" : 1
221
+ }
222
+ ]
201
223
},
202
224
{
203
225
"name" : " find" ,
328
350
}
329
351
},
330
352
{
331
- "name" : " count " ,
353
+ "name" : " aggregate " ,
332
354
"object" : " collection" ,
333
355
"collectionOptions" : {
334
356
"readPreference" : {
337
359
},
338
360
"arguments" : {
339
361
"session" : " session0" ,
340
- "filter" : {
341
- "_id" : 1
342
- }
362
+ "pipeline" : [
363
+ {
364
+ "$match" : {
365
+ "_id" : 1
366
+ }
367
+ },
368
+ {
369
+ "$count" : " count"
370
+ }
371
+ ]
343
372
},
344
373
"result" : {
345
374
"errorContains" : " read preference in a transaction must be primary"
439
468
}
440
469
},
441
470
{
442
- "name" : " count " ,
471
+ "name" : " aggregate " ,
443
472
"object" : " collection" ,
444
473
"collectionOptions" : {
445
474
"readPreference" : {
448
477
},
449
478
"arguments" : {
450
479
"session" : " session0" ,
451
- "filter" : {
452
- "_id" : 1
453
- }
480
+ "pipeline" : [
481
+ {
482
+ "$match" : {
483
+ "_id" : 1
484
+ }
485
+ },
486
+ {
487
+ "$count" : " count"
488
+ }
489
+ ]
454
490
},
455
491
"result" : {
456
492
"errorContains" : " read preference in a transaction must be primary"
550
586
}
551
587
},
552
588
{
553
- "name" : " count " ,
589
+ "name" : " aggregate " ,
554
590
"object" : " collection" ,
555
591
"collectionOptions" : {
556
592
"readPreference" : {
559
595
},
560
596
"arguments" : {
561
597
"session" : " session0" ,
562
- "filter" : {
563
- "_id" : 1
564
- }
598
+ "pipeline" : [
599
+ {
600
+ "$match" : {
601
+ "_id" : 1
602
+ }
603
+ },
604
+ {
605
+ "$count" : " count"
606
+ }
607
+ ]
565
608
},
566
609
"result" : {
567
610
"errorContains" : " read preference in a transaction must be primary"
Original file line number Diff line number Diff line change 99
99
"_id" : 1
100
100
}
101
101
},
102
- "result" : 1
103
- },
104
- {
105
- "name" : " count" ,
106
- "object" : " collection" ,
107
- "arguments" : {
108
- "session" : " session0" ,
109
- "filter" : {
110
- "_id" : 1
111
- }
112
- },
113
- "result" : 1
102
+ "result" : {
103
+ "errorContains" : " Cannot run 'count' in a multi-document transaction"
104
+ }
114
105
},
115
106
{
116
- "name" : " commitTransaction " ,
107
+ "name" : " abortTransaction " ,
117
108
"object" : " session0"
118
109
}
119
110
],
141
132
{
142
133
"command_started_event" : {
143
134
"command" : {
144
- "count" : " test" ,
145
- "query" : {
146
- "_id" : 1
147
- },
135
+ "abortTransaction" : 1 ,
148
136
"lsid" : " session0" ,
149
137
"txnNumber" : {
150
138
"$numberLong" : " 1"
153
141
"autocommit" : false ,
154
142
"writeConcern" : null
155
143
},
156
- "command_name" : " count" ,
157
- "database_name" : " transaction-tests"
158
- }
159
- },
160
- {
161
- "command_started_event" : {
162
- "command" : {
163
- "commitTransaction" : 1 ,
164
- "lsid" : " session0" ,
165
- "txnNumber" : {
166
- "$numberLong" : " 1"
167
- },
168
- "startTransaction" : null ,
169
- "autocommit" : false ,
170
- "writeConcern" : null
171
- },
172
- "command_name" : " commitTransaction" ,
144
+ "command_name" : " abortTransaction" ,
173
145
"database_name" : " admin"
174
146
}
175
147
}
Original file line number Diff line number Diff line change 242
242
{
243
243
"name" : " runCommand" ,
244
244
"object" : " database" ,
245
- "command_name" : " count " ,
245
+ "command_name" : " find " ,
246
246
"arguments" : {
247
247
"session" : " session0" ,
248
248
"command" : {
249
- "count " : " test"
249
+ "find " : " test"
250
250
},
251
251
"readPreference" : {
252
252
"mode" : " Secondary"
275
275
{
276
276
"name" : " runCommand" ,
277
277
"object" : " database" ,
278
- "command_name" : " count " ,
278
+ "command_name" : " find " ,
279
279
"arguments" : {
280
280
"session" : " session0" ,
281
281
"command" : {
282
- "count " : " test"
282
+ "find " : " test"
283
283
}
284
284
},
285
285
"result" : {
Original file line number Diff line number Diff line change 1250
1250
}
1251
1251
},
1252
1252
{
1253
- "name" : " count " ,
1253
+ "name" : " find " ,
1254
1254
"object" : " collection" ,
1255
1255
"arguments" : {
1256
1256
"session" : " session0" ,
1352
1352
}
1353
1353
},
1354
1354
{
1355
- "name" : " count " ,
1355
+ "name" : " find " ,
1356
1356
"object" : " collection" ,
1357
1357
"arguments" : {
1358
1358
"session" : " session0" ,
1461
1461
}
1462
1462
},
1463
1463
{
1464
- "name" : " count " ,
1464
+ "name" : " find " ,
1465
1465
"object" : " collection" ,
1466
1466
"arguments" : {
1467
1467
"session" : " session0" ,
You can’t perform that action at this time.
0 commit comments