Skip to content

Commit 415f681

Browse files
committed
fix: comment on distinct
1 parent 95ebb1e commit 415f681

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/operations/distinct.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,17 @@ export class DistinctOperation extends ModernizedCommandOperation<any[] | Docume
5656
}
5757

5858
override buildCommandDocument(_connection: Connection): Document {
59-
return {
59+
const command: Document = {
6060
distinct: this.collection.collectionName,
6161
key: this.key,
6262
query: this.query
6363
};
64+
// we check for undefined specifically here to allow falsy values
65+
// eslint-disable-next-line no-restricted-syntax
66+
if (this.options.comment !== undefined) {
67+
command.comment = this.options.comment;
68+
}
69+
return command;
6470
}
6571

6672
override handleOk(

0 commit comments

Comments
 (0)