|
1 | | -import { type Connection } from '..'; |
2 | 1 | import type { Document } from '../bson'; |
3 | 2 | import { CursorResponse, ExplainedCursorResponse } from '../cmap/wire_protocol/responses'; |
4 | 3 | import { type CursorTimeoutMode } from '../cursor/abstract_cursor'; |
5 | 4 | import { MongoInvalidArgumentError } from '../error'; |
6 | 5 | import { type ExplainOptions } from '../explain'; |
7 | | -import { maxWireVersion, type MongoDBNamespace } from '../utils'; |
| 6 | +import { type MongoDBNamespace } from '../utils'; |
8 | 7 | import { WriteConcern } from '../write_concern'; |
9 | 8 | import { type CollationOptions, CommandOperation, type CommandOperationOptions } from './command'; |
10 | 9 | import { Aspect, defineAspects, type Hint } from './operation'; |
11 | 10 |
|
12 | 11 | /** @internal */ |
13 | 12 | export const DB_AGGREGATE_COLLECTION = 1 as const; |
14 | | -const MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT = 8; |
15 | 13 |
|
16 | 14 | /** @public */ |
17 | 15 | export interface AggregateOptions extends Omit<CommandOperationOptions, 'explain'> { |
@@ -107,15 +105,10 @@ export class AggregateOperation extends CommandOperation<CursorResponse> { |
107 | 105 | this.pipeline.push(stage); |
108 | 106 | } |
109 | 107 |
|
110 | | - override buildCommandDocument(connection: Connection): Document { |
| 108 | + override buildCommandDocument(): Document { |
111 | 109 | const options = this.options; |
112 | | - const serverWireVersion = maxWireVersion(connection); |
113 | 110 | const command: Document = { aggregate: this.target, pipeline: this.pipeline }; |
114 | 111 |
|
115 | | - if (this.hasWriteStage && serverWireVersion < MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT) { |
116 | | - this.readConcern = undefined; |
117 | | - } |
118 | | - |
119 | 112 | if (this.hasWriteStage && this.writeConcern) { |
120 | 113 | WriteConcern.apply(command, this.writeConcern); |
121 | 114 | } |
|
0 commit comments