diff --git a/etc/notes/CHANGES_5.0.0.md b/etc/notes/CHANGES_5.0.0.md index 7729a4b87a..483cbecf53 100644 --- a/etc/notes/CHANGES_5.0.0.md +++ b/etc/notes/CHANGES_5.0.0.md @@ -16,6 +16,11 @@ The following is a detailed collection of the changes in the major v5 release of ## Changes +### `CursorCloseOptions` removed + +When calling `close()` on a `Cursor`, no more options can be provided. This removes support for the +`skipKillCursors` option that was unused. + ### Snappy v7.x.x or later and optional peerDependency `snappy` compression has been added to the package.json as a peerDependency that is **optional**. diff --git a/src/cursor/abstract_cursor.ts b/src/cursor/abstract_cursor.ts index 39dfc06bf9..b5fff69b30 100644 --- a/src/cursor/abstract_cursor.ts +++ b/src/cursor/abstract_cursor.ts @@ -58,14 +58,6 @@ export const CURSOR_FLAGS = [ 'partial' ] as const; -/** @public - * @deprecated This interface is deprecated */ -export interface CursorCloseOptions { - /** Bypass calling killCursors when closing the cursor. */ - /** @deprecated the skipKillCursors option is deprecated */ - skipKillCursors?: boolean; -} - /** @public */ export interface CursorStreamOptions { /** A transformation method applied to each document emitted by the stream */ @@ -447,18 +439,7 @@ export abstract class AbstractCursor< close(): Promise; /** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ close(callback: Callback): void; - /** - * @deprecated options argument is deprecated - */ - close(options: CursorCloseOptions): Promise; - /** - * @deprecated options argument is deprecated. Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance - */ - close(options: CursorCloseOptions, callback: Callback): void; - close(options?: CursorCloseOptions | Callback, callback?: Callback): Promise | void { - if (typeof options === 'function') (callback = options), (options = {}); - options = options ?? {}; - + close(callback?: Callback): Promise | void { const needsToEmitClosed = !this[kClosed]; this[kClosed] = true; diff --git a/src/index.ts b/src/index.ts index 75d9b9c7de..46a5999072 100644 --- a/src/index.ts +++ b/src/index.ts @@ -257,7 +257,6 @@ export type { MONGO_CLIENT_EVENTS } from './constants'; export type { AbstractCursorEvents, AbstractCursorOptions, - CursorCloseOptions, CursorFlag, CursorStreamOptions } from './cursor/abstract_cursor';