From 48f295a2ab38e284c9437300aab35a4678650c87 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Thu, 18 Aug 2022 10:26:36 -0400 Subject: [PATCH] feat(NODE-4548): export ChangeStream class from top-level (#3357) --- src/collection.ts | 12 ++++++------ src/index.ts | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/collection.ts b/src/collection.ts index 7cfb5e41cfc..3f142e7f40b 100644 --- a/src/collection.ts +++ b/src/collection.ts @@ -1610,13 +1610,13 @@ export class Collection { * Updates documents. * * @deprecated use updateOne, updateMany or bulkWrite - * @param selector - The selector for the update operation. + * @param filter - The filter for the update operation. * @param update - The update operations to be applied to the documents * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ update( - selector: Filter, + filter: Filter, update: UpdateFilter, options: UpdateOptions, callback: Callback @@ -1627,19 +1627,19 @@ export class Collection { if (typeof options === 'function') (callback = options), (options = {}); options = options ?? {}; - return this.updateMany(selector, update, options, callback); + return this.updateMany(filter, update, options, callback); } /** * Remove documents. * * @deprecated use deleteOne, deleteMany or bulkWrite - * @param selector - The selector for the update operation. + * @param filter - The filter for the remove operation. * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ remove( - selector: Filter, + filter: Filter, options: DeleteOptions, callback: Callback ): Promise | void { @@ -1649,7 +1649,7 @@ export class Collection { if (typeof options === 'function') (callback = options), (options = {}); options = options ?? {}; - return this.deleteMany(selector, options, callback); + return this.deleteMany(filter, options, callback); } /** diff --git a/src/index.ts b/src/index.ts index 19df2ff7313..2fa96b8938e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,6 @@ import { Admin } from './admin'; import { ObjectId } from './bson'; +import { ChangeStream } from './change_stream'; import { Collection } from './collection'; import { AbstractCursor } from './cursor/abstract_cursor'; import { AggregationCursor } from './cursor/aggregation_cursor'; @@ -78,6 +79,7 @@ export { Admin, AggregationCursor, CancellationToken, + ChangeStream, Collection, Db, FindCursor, @@ -172,7 +174,6 @@ export type { export type { OrderedBulkOperation } from './bulk/ordered'; export type { UnorderedBulkOperation } from './bulk/unordered'; export type { - ChangeStream, ChangeStreamCollModDocument, ChangeStreamCreateDocument, ChangeStreamCreateIndexDocument,