Skip to content

Commit 37cd6b2

Browse files
Use optons?: Document
1 parent e136f6a commit 37cd6b2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/shell-api/src/stream-processor.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,21 @@ export default class StreamProcessor extends ShellApiWithMongoClass {
6464
* sp.name.modify(newPipeline)
6565
* Keep the same pipeline, change other options:
6666
* sp.name.modify({resumeFromCheckpoint: false})
67+
* Change the pipeline and set additional options:
68+
* sp.name.modify(newPipeline, {resumeFromCheckpoint: false})
6769
*/
6870
async modify(options: Document): Promise<Document>;
6971
async modify(pipeline: Document[], options?: Document): Promise<Document>;
7072

71-
/**
72-
* modify is used to modify a stream processor definition, like below:
73-
* Change the pipeline and set additional options:
74-
* sp.name.modify(newPipeline, {resumeFromCheckpoint: false})
75-
*/
7673
@returnsPromise
7774
async modify(
7875
pipelineOrOptions: Document[] | Document,
79-
options: Document = {}
76+
options?: Document
8077
): Promise<Document> {
8178
if (Array.isArray(pipelineOrOptions)) {
8279
options = { ...options, pipeline: pipelineOrOptions };
8380
} else if (typeof pipelineOrOptions === 'object') {
84-
if (Object.keys(options).length !== 0) {
81+
if (options) {
8582
throw new MongoshInvalidInputError(
8683
'If the first argument to modify is an object, the second argument should not be specified.',
8784
CommonErrors.InvalidArgument

0 commit comments

Comments
 (0)