Skip to content

Commit a6bf329

Browse files
committed
fix: lint
1 parent 4c006bc commit a6bf329

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

src/collection.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {
3939
type EstimatedDocumentCountOptions
4040
} from './operations/estimated_document_count';
4141
import { executeOperation } from './operations/execute_operation';
42-
import { type FindOptions } from './operations/find';
42+
import { type FindOneOptions, type FindOptions } from './operations/find';
4343
import {
4444
FindOneAndDeleteOperation,
4545
type FindOneAndDeleteOptions,
@@ -48,7 +48,6 @@ import {
4848
FindOneAndUpdateOperation,
4949
type FindOneAndUpdateOptions
5050
} from './operations/find_and_modify';
51-
import { FindOneOperation, type FindOneOptions } from './operations/find_one';
5251
import {
5352
CreateIndexesOperation,
5453
type CreateIndexesOptions,

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,12 @@ export type { DeleteOptions, DeleteResult, DeleteStatement } from './operations/
523523
export type { DistinctOptions } from './operations/distinct';
524524
export type { DropCollectionOptions, DropDatabaseOptions } from './operations/drop';
525525
export type { EstimatedDocumentCountOptions } from './operations/estimated_document_count';
526-
export type { FindOptions } from './operations/find';
526+
export type { FindOneOptions, FindOptions } from './operations/find';
527527
export type {
528528
FindOneAndDeleteOptions,
529529
FindOneAndReplaceOptions,
530530
FindOneAndUpdateOptions
531531
} from './operations/find_and_modify';
532-
export type { FindOneOptions } from './operations/find_one';
533532
export type { IndexInformationOptions } from './operations/indexes';
534533
export type {
535534
CreateIndexesOptions,

src/operations/execute_operation.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ async function tryOperation<
232232
let previousServer: ServerDescription | undefined;
233233

234234
for (let tries = 0; tries < maxTries; tries++) {
235-
console.log('trying', tries, maxTries, willRetry, operation.commandName);
236235
if (previousOperationError) {
237236
if (hasWriteAspect && previousOperationError.code === MMAPv1_RETRY_WRITES_ERROR_CODE) {
238237
throw new MongoServerError({
@@ -250,7 +249,6 @@ async function tryOperation<
250249
throw previousOperationError;
251250

252251
if (hasReadAspect && !isRetryableReadError(previousOperationError)) {
253-
console.log(previousOperationError, isRetryableReadError(previousOperationError));
254252
throw previousOperationError;
255253
}
256254

@@ -283,10 +281,8 @@ async function tryOperation<
283281
if (tries > 0 && operation.hasAspect(Aspect.COMMAND_BATCHING)) {
284282
operation.resetBatch();
285283
}
286-
console.log('executing', operation.commandName);
287284
return await operation.execute(server, session, timeoutContext);
288285
} catch (operationError) {
289-
console.log('operationError', operationError);
290286
if (!(operationError instanceof MongoError)) throw operationError;
291287
if (
292288
previousOperationError != null &&

src/operations/find.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ export interface FindOptions<TSchema extends Document = Document>
8181
timeoutMode?: CursorTimeoutMode;
8282
}
8383

84+
/** @public */
85+
export interface FindOneOptions extends FindOptions {
86+
/** @deprecated Will be removed in the next major version. User provided value will be ignored. */
87+
batchSize?: number;
88+
/** @deprecated Will be removed in the next major version. User provided value will be ignored. */
89+
limit?: number;
90+
/** @deprecated Will be removed in the next major version. User provided value will be ignored. */
91+
noCursorTimeout?: boolean;
92+
}
93+
8494
/** @internal */
8595
export class FindOperation extends CommandOperation<CursorResponse> {
8696
/**

src/operations/find_one.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,9 @@ import type { ClientSession } from '../sessions';
77
import { type TimeoutContext } from '../timeout';
88
import { MongoDBNamespace } from '../utils';
99
import { CommandOperation } from './command';
10-
import { type FindOptions, makeFindCommand } from './find';
10+
import { type FindOneOptions, makeFindCommand } from './find';
1111
import { Aspect, defineAspects } from './operation';
1212

13-
/** @public */
14-
export interface FindOneOptions extends FindOptions {
15-
/** @deprecated Will be removed in the next major version. User provided value will be ignored. */
16-
batchSize?: number;
17-
/** @deprecated Will be removed in the next major version. User provided value will be ignored. */
18-
limit?: number;
19-
/** @deprecated Will be removed in the next major version. User provided value will be ignored. */
20-
noCursorTimeout?: boolean;
21-
}
22-
2313
/** @internal */
2414
export class FindOneOperation<TSchema = any> extends CommandOperation<TSchema> {
2515
override options: FindOneOptions;

0 commit comments

Comments
 (0)