File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ const MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT = 8;
12
12
13
13
class AggregateOperation extends CommandOperationV2 {
14
14
constructor ( parent , pipeline , options ) {
15
+ // ensure we receive an unchanged raw response from the server (for cursor logic)
16
+ options . full = true ;
15
17
super ( parent , options ) ;
16
18
17
19
this . target =
@@ -41,9 +43,14 @@ class AggregateOperation extends CommandOperationV2 {
41
43
execute ( server , callback ) {
42
44
const options = this . options ;
43
45
const serverWireVersion = maxWireVersion ( server ) ;
46
+ const inTransaction = this . session && this . session . inTransaction ( ) ;
44
47
45
48
const command = { aggregate : this . target , pipeline : this . pipeline } ;
46
- if ( ! this . hasWriteStage || serverWireVersion >= MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT ) {
49
+
50
+ if (
51
+ ( ! this . hasWriteStage || serverWireVersion >= MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT ) &&
52
+ ! inTransaction
53
+ ) {
47
54
Object . assign ( command , { readConcern : this . readConcern } ) ;
48
55
}
49
56
You can’t perform that action at this time.
0 commit comments