@@ -61,26 +61,16 @@ class AggregateOperation extends CommandOperationV2 {
61
61
execute ( server , callback ) {
62
62
const options = this . options ;
63
63
const serverWireVersion = maxWireVersion ( server ) ;
64
- const inTransaction = this . session && this . session . inTransaction ( ) ;
65
-
66
64
const command = { aggregate : this . target , pipeline : this . pipeline } ;
67
65
68
- if (
69
- this . readConcern &&
70
- ( ! this . hasWriteStage || serverWireVersion >= MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT ) &&
71
- ! inTransaction
72
- ) {
73
- Object . assign ( command , { readConcern : this . readConcern } ) ;
66
+ if ( this . hasWriteStage && serverWireVersion < MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT ) {
67
+ this . readConcern = null ;
74
68
}
75
69
76
70
if ( serverWireVersion >= 5 ) {
77
71
if ( this . hasWriteStage && this . writeConcern ) {
78
72
Object . assign ( command , { writeConcern : this . writeConcern } ) ;
79
73
}
80
-
81
- if ( options . collation && typeof options . collation === 'object' ) {
82
- Object . assign ( command , { collation : options . collation } ) ;
83
- }
84
74
}
85
75
86
76
if ( options . bypassDocumentValidation === true ) {
@@ -91,10 +81,6 @@ class AggregateOperation extends CommandOperationV2 {
91
81
command . allowDiskUse = options . allowDiskUse ;
92
82
}
93
83
94
- if ( typeof options . maxTimeMS === 'number' ) {
95
- command . maxTimeMS = options . maxTimeMS ;
96
- }
97
-
98
84
if ( options . hint ) {
99
85
command . hint = options . hint ;
100
86
}
@@ -104,10 +90,6 @@ class AggregateOperation extends CommandOperationV2 {
104
90
command . explain = options . explain ;
105
91
}
106
92
107
- if ( typeof options . comment === 'string' ) {
108
- command . comment = options . comment ;
109
- }
110
-
111
93
command . cursor = options . cursor || { } ;
112
94
if ( options . batchSize && ! this . hasWriteStage ) {
113
95
command . cursor . batchSize = options . batchSize ;
0 commit comments