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.
- package/lib/beta.d.ts +7 -1
- package/lib/cmap/connection.js +1 -3
- package/lib/cmap/connection.js.map +1 -1
- package/lib/cursor/change_stream_cursor.js +2 -3
- package/lib/cursor/change_stream_cursor.js.map +1 -1
- package/lib/error.js +3 -0
- package/lib/error.js.map +1 -1
- package/lib/operations/aggregate.js +1 -7
- package/lib/operations/aggregate.js.map +1 -1
- package/lib/operations/find_and_modify.js +1 -1
- package/lib/operations/find_and_modify.js.map +1 -1
- package/lib/read_preference.js.map +1 -1
- package/lib/sdam/server.js +1 -1
- package/lib/sdam/server.js.map +1 -1
- package/lib/sdam/server_selection.js +0 -6
- package/lib/sdam/server_selection.js.map +1 -1
- package/lib/sdam/topology.js +12 -9
- package/lib/sdam/topology.js.map +1 -1
- package/lib/sessions.js +0 -8
- package/lib/sessions.js.map +1 -1
- package/lib/utils.js +2 -8
- package/lib/utils.js.map +1 -1
- package/mongodb.d.ts +7 -1
- package/package.json +1 -1
- package/src/cmap/connection.ts +1 -6
- package/src/cursor/change_stream_cursor.ts +2 -3
- package/src/error.ts +4 -0
- package/src/operations/aggregate.ts +2 -9
- package/src/operations/find_and_modify.ts +1 -1
- package/src/read_preference.ts +3 -0
- package/src/sdam/server.ts +1 -1
- package/src/sdam/server_selection.ts +1 -12
- package/src/sdam/topology.ts +12 -9
- package/src/sessions.ts +0 -15
- package/src/utils.ts +2 -12
package/src/sdam/topology.ts
CHANGED
|
@@ -1104,7 +1104,10 @@ function isStaleServerDescription(
|
|
|
1104
1104
|
);
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
1107
|
-
/**
|
|
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
|
|
1121
|
+
return true;
|
|
1119
1122
|
}
|
|
1120
1123
|
|
|
1121
1124
|
get hasWriteCommands(): boolean {
|
|
1122
|
-
return
|
|
1125
|
+
return true;
|
|
1123
1126
|
}
|
|
1124
1127
|
get hasTextSearch(): boolean {
|
|
1125
|
-
return
|
|
1128
|
+
return true;
|
|
1126
1129
|
}
|
|
1127
1130
|
|
|
1128
1131
|
get hasAuthCommands(): boolean {
|
|
1129
|
-
return
|
|
1132
|
+
return true;
|
|
1130
1133
|
}
|
|
1131
1134
|
|
|
1132
1135
|
get hasListCollectionsCommand(): boolean {
|
|
1133
|
-
return
|
|
1136
|
+
return true;
|
|
1134
1137
|
}
|
|
1135
1138
|
|
|
1136
1139
|
get hasListIndexesCommand(): boolean {
|
|
1137
|
-
return
|
|
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
|
|
1148
|
+
return true;
|
|
1146
1149
|
}
|
|
1147
1150
|
|
|
1148
1151
|
get commandsTakeCollation(): boolean {
|
|
1149
|
-
return
|
|
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
|
-
|
|
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
|
|