Skip to content

Commit 62d7789

Browse files
committed
feat(NODE-5510): dont filter change stream options
1 parent 88e02a4 commit 62d7789

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

src/change_stream.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,7 @@ import type { OperationParent } from './operations/command';
2121
import { type AsyncDisposable, configureResourceManagement } from './resource_management';
2222
import type { ServerSessionId } from './sessions';
2323
import { CSOTTimeoutContext, type TimeoutContext } from './timeout';
24-
import { filterOptions, getTopology, type MongoDBNamespace, squashError } from './utils';
25-
26-
const CHANGE_STREAM_OPTIONS = [
27-
'resumeAfter',
28-
'startAfter',
29-
'startAtOperationTime',
30-
'fullDocument',
31-
'fullDocumentBeforeChange',
32-
'showExpandedEvents'
33-
] as const;
24+
import { getTopology, type MongoDBNamespace, squashError } from './utils';
3425

3526
const CHANGE_DOMAIN_TYPES = {
3627
COLLECTION: Symbol('Collection'),
@@ -904,7 +895,7 @@ export class ChangeStream<
904895
private _createChangeStreamCursor(
905896
options: ChangeStreamOptions | ChangeStreamCursorOptions
906897
): ChangeStreamCursor<TSchema, TChange> {
907-
const changeStreamStageOptions = filterOptions(options, CHANGE_STREAM_OPTIONS);
898+
const changeStreamStageOptions: Document = { ...options };
908899
if (this.type === CHANGE_DOMAIN_TYPES.CLUSTER) {
909900
changeStreamStageOptions.allChangesForCluster = true;
910901
}

test/integration/change-streams/change_stream.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ describe('Change Streams', function () {
160160
});
161161
});
162162

163-
it('ignores any invalid option values', function () {
163+
it('allows invalid option values', function () {
164164
const changeStream = collection.watch([], { invalidOption: true });
165165

166-
expect(changeStream).not.to.have.nested.property(
166+
expect(changeStream).to.have.nested.property(
167167
'cursor.pipeline[0].$changeStream.invalidOption'
168168
);
169169
});

0 commit comments

Comments
 (0)