Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(NODE-4548): export ChangeStream class from top-level #3357

Merged
merged 5 commits into from Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for changing these to our spec language.

* @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 @@ -76,6 +77,7 @@ export {
Admin,
AggregationCursor,
CancellationToken,
ChangeStream,
Collection,
Db,
FindCursor,
Expand Down Expand Up @@ -170,7 +172,6 @@ export type {
export type { OrderedBulkOperation } from './bulk/ordered';
export type { UnorderedBulkOperation } from './bulk/unordered';
export type {
ChangeStream,
ChangeStreamCollModDocument,
ChangeStreamCreateDocument,
ChangeStreamCreateIndexDocument,
Expand Down