Skip to content

Commit d29210e

Browse files
nbbeekendariakp
authored andcommitted
chore(NODE-6493): CSOT clean ups and sync runCursorCommand test (#4309)
1 parent 7d548a8 commit d29210e

25 files changed

+48
-137
lines changed

etc/notes/errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ This class should **never** be directly instantiated.
111111

112112
### `MongoOperationTimeoutError`
113113

114-
- TODO(NODE-5688): Add MongoOperationTimeoutError documentation
114+
- TODO(NODE-6491): Add MongoOperationTimeoutError documentation
115115

116116
### MongoUnexpectedServerResponseError
117117

src/change_stream.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,8 @@ export type ChangeStreamEvents<
543543
/**
544544
* @remarks Note that the `close` event is currently emitted whenever the internal `ChangeStreamCursor`
545545
* instance is closed, which can occur multiple times for a given `ChangeStream` instance.
546+
*
547+
* TODO(NODE-6434): address this issue in NODE-6434
546548
*/
547549
close(): void;
548550
};

src/connection_string.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ export const OPTIONS = {
10921092
type: 'string'
10931093
},
10941094
socketTimeoutMS: {
1095-
deprecated: 'Please use timeoutMS instead',
1095+
// TODO(NODE-6491): deprecated: 'Please use timeoutMS instead',
10961096
default: 0,
10971097
type: 'uint'
10981098
},
@@ -1163,7 +1163,7 @@ export const OPTIONS = {
11631163
}
11641164
},
11651165
waitQueueTimeoutMS: {
1166-
deprecated: 'Please use timeoutMS instead',
1166+
// TODO(NODE-6491): deprecated: 'Please use timeoutMS instead',
11671167
default: 0,
11681168
type: 'uint'
11691169
},

src/cursor/abstract_cursor.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ export interface AbstractCursorOptions extends BSONSerializeOptions {
113113
/**
114114
* When applicable `maxTimeMS` controls the amount of time the initial command
115115
* that constructs a cursor should take. (ex. find, aggregate, listCollections)
116-
* @deprecated Will be removed in the next major version. Please use timeoutMS instead.
117116
*/
118117
maxTimeMS?: number;
119118
/**
@@ -775,7 +774,6 @@ export abstract class AbstractCursor<
775774
* Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher)
776775
*
777776
* @param value - Number of milliseconds to wait before aborting the query.
778-
* @deprecated Will be removed in the next major version. Please use the timeoutMS option instead.
779777
*/
780778
maxTimeMS(value: number): this {
781779
this.throwIfInitialized();

src/cursor/run_command_cursor.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ export class RunCommandCursor extends AbstractCursor {
8181
/**
8282
* Controls the `getMore.maxTimeMS` field. Only valid when cursor is tailable await
8383
* @param maxTimeMS - the number of milliseconds to wait for new data
84-
* @deprecated Will be removed in the next major version. Please use timeoutMS instead.
8584
*/
8685
public setMaxTimeMS(maxTimeMS: number): this {
8786
this.getMoreOptions.maxAwaitTimeMS = maxTimeMS;
@@ -118,7 +117,6 @@ export class RunCommandCursor extends AbstractCursor {
118117

119118
/**
120119
* Unsupported for RunCommandCursor: maxTimeMS must be configured directly on command document
121-
* @deprecated Will be removed in the next major version.
122120
*/
123121
public override maxTimeMS(_: number): never {
124122
throw new MongoAPIError(

src/error.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ function isAggregateError(e: unknown): e is Error & { errors: Error[] } {
128128
* mongodb-client-encryption has a dependency on this error, it uses the constructor with a string argument
129129
*/
130130
export class MongoError extends Error {
131-
get [Symbol.toStringTag]() {
132-
return this.name;
133-
}
134131
/** @internal */
135132
[kErrorLabels]: Set<string>;
136133
/**

src/mongo_client.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeC
155155
tlsInsecure?: boolean;
156156
/** The time in milliseconds to attempt a connection before timing out. */
157157
connectTimeoutMS?: number;
158-
/**
159-
* The time in milliseconds to attempt a send or receive on a socket before the attempt times out.
160-
* @deprecated Will be removed in the next major version. Please use timeoutMS instead
161-
*/
158+
/** The time in milliseconds to attempt a send or receive on a socket before the attempt times out. */
162159
socketTimeoutMS?: number;
163160
/** An array or comma-delimited string of compressors to enable network compression for communication between this client and a mongod/mongos instance. */
164161
compressors?: CompressorName[] | string;
@@ -182,10 +179,7 @@ export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeC
182179
maxConnecting?: number;
183180
/** The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed. */
184181
maxIdleTimeMS?: number;
185-
/**
186-
* The maximum time in milliseconds that a thread can wait for a connection to become available.
187-
* @deprecated Will be removed in the next major version. Please use timeoutMS instead
188-
*/
182+
/** The maximum time in milliseconds that a thread can wait for a connection to become available. */
189183
waitQueueTimeoutMS?: number;
190184
/** Specify a read concern for the collection (only MongoDB 3.2 or higher supported) */
191185
readConcern?: ReadConcernLike;

src/operations/aggregate.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export interface AggregateOptions extends Omit<CommandOperationOptions, 'explain
2828
cursor?: Document;
2929
/**
3030
* Specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point.
31-
* @deprecated Will be removed in the next major version. Please use timeoutMS instead.
3231
*/
3332
maxTimeMS?: number;
3433
/** The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. */

src/operations/command.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export interface CommandOperationOptions
4242
collation?: CollationOptions;
4343
/**
4444
* maxTimeMS is a server-side time limit in milliseconds for processing an operation.
45-
* @deprecated Will be removed in the next major version. Please use timeoutMS instead.
4645
*/
4746
maxTimeMS?: number;
4847
/**

src/operations/count.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export interface CountOptions extends CommandOperationOptions {
1515
limit?: number;
1616
/**
1717
* Number of milliseconds to wait before aborting the query.
18-
* @deprecated Will be removed in the next major version. Please use timeoutMS instead.
1918
*/
2019
maxTimeMS?: number;
2120
/** An index name hint for the query. */

0 commit comments

Comments
 (0)