mongodb 6.20.0-dev.20251007.sha.3f7196eb → 6.20.0-dev.20251008.sha.cfbada66

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.
Files changed (56) hide show
  1. package/lib/beta.d.ts +7 -137
  2. package/lib/bulk/common.js +7 -9
  3. package/lib/bulk/common.js.map +1 -1
  4. package/lib/change_stream.js.map +1 -1
  5. package/lib/cmap/connection.js.map +1 -1
  6. package/lib/cmap/connection_pool.js.map +1 -1
  7. package/lib/cmap/handshake/client_metadata.js.map +1 -1
  8. package/lib/cmap/wire_protocol/constants.js +3 -1
  9. package/lib/cmap/wire_protocol/constants.js.map +1 -1
  10. package/lib/collection.js +1 -1
  11. package/lib/collection.js.map +1 -1
  12. package/lib/connection_string.js +0 -8
  13. package/lib/connection_string.js.map +1 -1
  14. package/lib/gridfs/download.js.map +1 -1
  15. package/lib/gridfs/upload.js +2 -8
  16. package/lib/gridfs/upload.js.map +1 -1
  17. package/lib/index.js.map +1 -1
  18. package/lib/mongo_types.js +1 -2
  19. package/lib/mongo_types.js.map +1 -1
  20. package/lib/operations/command.js.map +1 -1
  21. package/lib/operations/create_collection.js +0 -1
  22. package/lib/operations/create_collection.js.map +1 -1
  23. package/lib/operations/execute_operation.js +3 -1
  24. package/lib/operations/execute_operation.js.map +1 -1
  25. package/lib/operations/find.js.map +1 -1
  26. package/lib/read_preference.js +0 -4
  27. package/lib/read_preference.js.map +1 -1
  28. package/lib/sdam/topology.js +1 -42
  29. package/lib/sdam/topology.js.map +1 -1
  30. package/lib/transactions.js +2 -13
  31. package/lib/transactions.js.map +1 -1
  32. package/lib/utils.js +0 -14
  33. package/lib/utils.js.map +1 -1
  34. package/mongodb.d.ts +7 -137
  35. package/package.json +1 -1
  36. package/src/bulk/common.ts +9 -11
  37. package/src/change_stream.ts +1 -17
  38. package/src/cmap/connection.ts +1 -0
  39. package/src/cmap/connection_pool.ts +0 -9
  40. package/src/cmap/handshake/client_metadata.ts +0 -13
  41. package/src/cmap/wire_protocol/constants.ts +2 -0
  42. package/src/collection.ts +1 -1
  43. package/src/connection_string.ts +0 -10
  44. package/src/gridfs/download.ts +0 -4
  45. package/src/gridfs/upload.ts +0 -22
  46. package/src/index.ts +1 -4
  47. package/src/mongo_types.ts +1 -2
  48. package/src/operations/command.ts +0 -7
  49. package/src/operations/create_collection.ts +0 -3
  50. package/src/operations/execute_operation.ts +6 -2
  51. package/src/operations/find.ts +2 -11
  52. package/src/read_preference.ts +0 -9
  53. package/src/sdam/topology.ts +0 -53
  54. package/src/sessions.ts +1 -1
  55. package/src/transactions.ts +2 -17
  56. package/src/utils.ts +0 -18
@@ -393,10 +393,6 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
393
393
  return this.s.options.serverApi;
394
394
  }
395
395
 
396
- get capabilities(): ServerCapabilities {
397
- return new ServerCapabilities(this.lastHello());
398
- }
399
-
400
396
  /** Initiate server connect */
401
397
  async connect(options?: ConnectOptions): Promise<Topology> {
402
398
  this.connectionLock ??= this._connect(options);
@@ -1103,52 +1099,3 @@ function isStaleServerDescription(
1103
1099
  compareTopologyVersion(currentTopologyVersion, incomingServerDescription.topologyVersion) > 0
1104
1100
  );
1105
1101
  }
1106
-
1107
- /**
1108
- * @public
1109
- * @deprecated This class will be removed as dead code in the next major version.
1110
- */
1111
- export class ServerCapabilities {
1112
- maxWireVersion: number;
1113
- minWireVersion: number;
1114
-
1115
- constructor(hello: Document) {
1116
- this.minWireVersion = hello.minWireVersion || 0;
1117
- this.maxWireVersion = hello.maxWireVersion || 0;
1118
- }
1119
-
1120
- get hasAggregationCursor(): boolean {
1121
- return true;
1122
- }
1123
-
1124
- get hasWriteCommands(): boolean {
1125
- return true;
1126
- }
1127
- get hasTextSearch(): boolean {
1128
- return true;
1129
- }
1130
-
1131
- get hasAuthCommands(): boolean {
1132
- return true;
1133
- }
1134
-
1135
- get hasListCollectionsCommand(): boolean {
1136
- return true;
1137
- }
1138
-
1139
- get hasListIndexesCommand(): boolean {
1140
- return true;
1141
- }
1142
-
1143
- get supportsSnapshotReads(): boolean {
1144
- return this.maxWireVersion >= 13;
1145
- }
1146
-
1147
- get commandsTakeWriteConcern(): boolean {
1148
- return true;
1149
- }
1150
-
1151
- get commandsTakeCollation(): boolean {
1152
- return true;
1153
- }
1154
- }
package/src/sessions.ts CHANGED
@@ -118,7 +118,7 @@ export class ClientSession
118
118
  /** @internal */
119
119
  owner?: symbol | AbstractCursor;
120
120
  defaultTransactionOptions: TransactionOptions;
121
- /** @deprecated - Will be made internal in the next major release */
121
+ /** @internal */
122
122
  transaction: Transaction;
123
123
  /**
124
124
  * @internal
@@ -73,21 +73,15 @@ export interface TransactionOptions extends Omit<CommandOperationOptions, 'timeo
73
73
  }
74
74
 
75
75
  /**
76
- * @public
77
- * @deprecated - Will be made internal in a future major release.
78
- * A class maintaining state related to a server transaction. Internal Only
76
+ * @internal
79
77
  */
80
78
  export class Transaction {
81
- /** @internal */
82
79
  state: TxnState;
83
- /** @deprecated - Will be made internal in a future major release. */
84
80
  options: TransactionOptions;
85
- /** @internal */
86
81
  _pinnedServer?: Server;
87
- /** @internal */
88
82
  _recoveryToken?: Document;
89
83
 
90
- /** Create a transaction @internal */
84
+ /** Create a transaction */
91
85
  constructor(options?: TransactionOptions) {
92
86
  options = options ?? {};
93
87
  this.state = TxnState.NO_TRANSACTION;
@@ -119,23 +113,19 @@ export class Transaction {
119
113
  this._recoveryToken = undefined;
120
114
  }
121
115
 
122
- /** @internal */
123
116
  get server(): Server | undefined {
124
117
  return this._pinnedServer;
125
118
  }
126
119
 
127
- /** @deprecated - Will be made internal in a future major release. */
128
120
  get recoveryToken(): Document | undefined {
129
121
  return this._recoveryToken;
130
122
  }
131
123
 
132
- /** @deprecated - Will be made internal in a future major release. */
133
124
  get isPinned(): boolean {
134
125
  return !!this.server;
135
126
  }
136
127
 
137
128
  /**
138
- * @deprecated - Will be made internal in a future major release.
139
129
  * @returns Whether the transaction has started
140
130
  */
141
131
  get isStarting(): boolean {
@@ -143,20 +133,17 @@ export class Transaction {
143
133
  }
144
134
 
145
135
  /**
146
- * @deprecated - Will be made internal in a future major release.
147
136
  * @returns Whether this session is presently in a transaction
148
137
  */
149
138
  get isActive(): boolean {
150
139
  return ACTIVE_STATES.has(this.state);
151
140
  }
152
141
 
153
- /** @deprecated - Will be made internal in a future major release. */
154
142
  get isCommitted(): boolean {
155
143
  return COMMITTED_STATES.has(this.state);
156
144
  }
157
145
  /**
158
146
  * Transition the transaction in the state machine
159
- * @internal
160
147
  * @param nextState - The new state to transition to
161
148
  */
162
149
  transition(nextState: TxnState): void {
@@ -178,14 +165,12 @@ export class Transaction {
178
165
  );
179
166
  }
180
167
 
181
- /** @internal */
182
168
  pinServer(server: Server): void {
183
169
  if (this.isActive) {
184
170
  this._pinnedServer = server;
185
171
  }
186
172
  }
187
173
 
188
- /** @internal */
189
174
  unpinServer(): void {
190
175
  this._pinnedServer = undefined;
191
176
  }
package/src/utils.ts CHANGED
@@ -153,24 +153,6 @@ export function filterOptions(options: AnyOptions, names: ReadonlyArray<string>)
153
153
  return filterOptions;
154
154
  }
155
155
 
156
- interface HasRetryableWrites {
157
- retryWrites?: boolean;
158
- }
159
- /**
160
- * Applies retryWrites: true to a command if retryWrites is set on the command's database.
161
- * @internal
162
- *
163
- * @param target - The target command to which we will apply retryWrites.
164
- * @param db - The database from which we can inherit a retryWrites value.
165
- */
166
- export function applyRetryableWrites<T extends HasRetryableWrites>(target: T, db?: Db): T {
167
- if (db && db.s.options?.retryWrites) {
168
- target.retryWrites = true;
169
- }
170
-
171
- return target;
172
- }
173
-
174
156
  /**
175
157
  * Applies a write concern to a command based on well defined inheritance rules, optionally
176
158
  * detecting support for the write concern in the first place.