mongodb 6.19.0-dev.20250911.sha.c6172940 → 6.19.0-dev.20250917.sha.a6eca88c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1104,7 +1104,10 @@ function isStaleServerDescription(
1104
1104
  );
1105
1105
  }
1106
1106
 
1107
- /** @public */
1107
+ /**
1108
+ * @public
1109
+ * @deprecated This class will be removed as dead code in the next major version.
1110
+ */
1108
1111
  export class ServerCapabilities {
1109
1112
  maxWireVersion: number;
1110
1113
  minWireVersion: number;
@@ -1115,26 +1118,26 @@ export class ServerCapabilities {
1115
1118
  }
1116
1119
 
1117
1120
  get hasAggregationCursor(): boolean {
1118
- return this.maxWireVersion >= 1;
1121
+ return true;
1119
1122
  }
1120
1123
 
1121
1124
  get hasWriteCommands(): boolean {
1122
- return this.maxWireVersion >= 2;
1125
+ return true;
1123
1126
  }
1124
1127
  get hasTextSearch(): boolean {
1125
- return this.minWireVersion >= 0;
1128
+ return true;
1126
1129
  }
1127
1130
 
1128
1131
  get hasAuthCommands(): boolean {
1129
- return this.maxWireVersion >= 1;
1132
+ return true;
1130
1133
  }
1131
1134
 
1132
1135
  get hasListCollectionsCommand(): boolean {
1133
- return this.maxWireVersion >= 3;
1136
+ return true;
1134
1137
  }
1135
1138
 
1136
1139
  get hasListIndexesCommand(): boolean {
1137
- return this.maxWireVersion >= 3;
1140
+ return true;
1138
1141
  }
1139
1142
 
1140
1143
  get supportsSnapshotReads(): boolean {
@@ -1142,10 +1145,10 @@ export class ServerCapabilities {
1142
1145
  }
1143
1146
 
1144
1147
  get commandsTakeWriteConcern(): boolean {
1145
- return this.maxWireVersion >= 5;
1148
+ return true;
1146
1149
  }
1147
1150
 
1148
1151
  get commandsTakeCollation(): boolean {
1149
- return this.maxWireVersion >= 5;
1152
+ return true;
1150
1153
  }
1151
1154
  }
package/src/sessions.ts CHANGED
@@ -2,7 +2,6 @@ import { Binary, type Document, Long, type Timestamp } from './bson';
2
2
  import type { CommandOptions, Connection } from './cmap/connection';
3
3
  import { ConnectionPoolMetrics } from './cmap/metrics';
4
4
  import { type MongoDBResponse } from './cmap/wire_protocol/responses';
5
- import { isSharded } from './cmap/wire_protocol/shared';
6
5
  import { PINNED, UNPINNED } from './constants';
7
6
  import type { AbstractCursor } from './cursor/abstract_cursor';
8
7
  import {
@@ -42,7 +41,6 @@ import {
42
41
  commandSupportsReadConcern,
43
42
  isPromiseLike,
44
43
  List,
45
- maxWireVersion,
46
44
  MongoDBNamespace,
47
45
  noop,
48
46
  now,
@@ -51,8 +49,6 @@ import {
51
49
  } from './utils';
52
50
  import { WriteConcern, type WriteConcernOptions, type WriteConcernSettings } from './write_concern';
53
51
 
54
- const minWireVersionForShardedTransactions = 8;
55
-
56
52
  /** @public */
57
53
  export interface ClientSessionOptions {
58
54
  /** Whether causal consistency should be enabled on this session */
@@ -405,17 +401,6 @@ export class ClientSession
405
401
  this.unpin();
406
402
  }
407
403
 
408
- const topologyMaxWireVersion = maxWireVersion(this.client.topology);
409
- if (
410
- isSharded(this.client.topology) &&
411
- topologyMaxWireVersion != null &&
412
- topologyMaxWireVersion < minWireVersionForShardedTransactions
413
- ) {
414
- throw new MongoCompatibilityError(
415
- 'Transactions are not supported on sharded clusters in MongoDB < 4.2.'
416
- );
417
- }
418
-
419
404
  this.commitAttempted = false;
420
405
  // increment txnNumber
421
406
  this.incrementTransactionNumber();
package/src/utils.ts CHANGED
@@ -19,7 +19,6 @@ import type { Db } from './db';
19
19
  import {
20
20
  type AnyError,
21
21
  MongoAPIError,
22
- MongoCompatibilityError,
23
22
  MongoInvalidArgumentError,
24
23
  MongoNetworkTimeoutError,
25
24
  MongoNotConnectedError,
@@ -206,18 +205,9 @@ export function isPromiseLike<T = unknown>(value?: unknown): value is PromiseLik
206
205
  * @param target - target of command
207
206
  * @param options - options containing collation settings
208
207
  */
209
- export function decorateWithCollation(
210
- command: Document,
211
- target: MongoClient | Db | Collection,
212
- options: AnyOptions
213
- ): void {
214
- const capabilities = getTopology(target).capabilities;
208
+ export function decorateWithCollation(command: Document, options: AnyOptions): void {
215
209
  if (options.collation && typeof options.collation === 'object') {
216
- if (capabilities && capabilities.commandsTakeCollation) {
217
- command.collation = options.collation;
218
- } else {
219
- throw new MongoCompatibilityError(`Current topology does not support collation`);
220
- }
210
+ command.collation = options.collation;
221
211
  }
222
212
  }
223
213