Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1398,9 +1398,6 @@ export class Collection<TSchema extends Document = Document> {
pipeline: Document[] = [],
options: ChangeStreamOptions = {}
): ChangeStream<TLocal> {
pipeline = pipeline ?? [];
options = options ?? {};

// Allow optionally not specifying a pipeline
if (!Array.isArray(pipeline)) {
options = pipeline;
Expand Down
9 changes: 2 additions & 7 deletions src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,15 +714,10 @@ export class Db {
* @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents.
* @param options - Optional settings for the command
*/
watch<TSchema = Document>(): ChangeStream<TSchema>;
watch<TSchema = Document>(pipeline?: Document[]): ChangeStream<TSchema>;
watch<TSchema = Document>(
pipeline?: Document[],
options?: ChangeStreamOptions
pipeline: Document[] = [],
options: ChangeStreamOptions = {}
): ChangeStream<TSchema> {
pipeline = pipeline ?? [];
options = options ?? {};

// Allow optionally not specifying a pipeline
if (!Array.isArray(pipeline)) {
options = pipeline;
Expand Down
5 changes: 0 additions & 5 deletions src/mongo_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,15 +596,10 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
* @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents.
* @param options - Optional settings for the command
*/
watch<TSchema = Document>(): ChangeStream<TSchema>;
watch<TSchema = Document>(pipeline?: Document[]): ChangeStream<TSchema>;
watch<TSchema = Document>(
pipeline: Document[] = [],
options: ChangeStreamOptions = {}
): ChangeStream<TSchema> {
pipeline = pipeline ?? [];
options = options ?? {};

// Allow optionally not specifying a pipeline
if (!Array.isArray(pipeline)) {
options = pipeline;
Expand Down