Skip to content

Commit

Permalink
feat(NODE-4548): export ChangeStream class from top-level (#3357)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Aug 18, 2022
1 parent 40d485c commit 48f295a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/collection.ts
Expand Up @@ -1610,13 +1610,13 @@ export class Collection<TSchema extends Document = Document> {
* 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<TSchema>,
filter: Filter<TSchema>,
update: UpdateFilter<TSchema>,
options: UpdateOptions,
callback: Callback<Document>
Expand All @@ -1627,19 +1627,19 @@ export class Collection<TSchema extends Document = Document> {
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<TSchema>,
filter: Filter<TSchema>,
options: DeleteOptions,
callback: Callback
): Promise<DeleteResult> | void {
Expand All @@ -1649,7 +1649,7 @@ export class Collection<TSchema extends Document = Document> {
if (typeof options === 'function') (callback = options), (options = {});
options = options ?? {};

return this.deleteMany(selector, options, callback);
return this.deleteMany(filter, options, callback);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion 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';
Expand Down Expand Up @@ -78,6 +79,7 @@ export {
Admin,
AggregationCursor,
CancellationToken,
ChangeStream,
Collection,
Db,
FindCursor,
Expand Down Expand Up @@ -172,7 +174,6 @@ export type {
export type { OrderedBulkOperation } from './bulk/ordered';
export type { UnorderedBulkOperation } from './bulk/unordered';
export type {
ChangeStream,
ChangeStreamCollModDocument,
ChangeStreamCreateDocument,
ChangeStreamCreateIndexDocument,
Expand Down

0 comments on commit 48f295a

Please sign in to comment.