Skip to content

Commit b1b36fb

Browse files
remove comment from commands pre-4.4
1 parent 3182e8d commit b1b36fb

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

src/operations/command.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ export abstract class CommandOperation<T> extends AbstractOperation<T> {
179179
cmd.maxTimeMS = options.maxTimeMS;
180180
}
181181

182-
if (typeof options.comment === 'string') {
183-
cmd.comment = options.comment;
184-
}
185-
186182
if (this.hasAspect(Aspect.EXPLAINABLE) && this.explain) {
187183
if (serverWireVersion < 6 && cmd.aggregate) {
188184
// Prior to 3.6, with aggregate, verbosity is ignored, and we must pass in "explain: true"

test/integration/enumerate_collections.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ const testSuite = new UnifiedTestSuiteBuilder('listCollections with comment opti
2525
{
2626
commandStartedEvent: {
2727
command: {
28-
listCollections: 1
28+
listCollections: 1,
29+
comment: { $$exists: false }
2930
}
3031
}
3132
}

test/integration/enumerate_databases.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ const testSuite = new UnifiedTestSuiteBuilder('listDatabases with comment option
156156
.operation({
157157
name: 'listDatabases',
158158
arguments: {
159-
filter: {}
159+
filter: {},
160+
comment: 'string value'
160161
},
161162
object: 'client0'
162163
})
@@ -166,7 +167,8 @@ const testSuite = new UnifiedTestSuiteBuilder('listDatabases with comment option
166167
{
167168
commandStartedEvent: {
168169
command: {
169-
listDatabases: 1
170+
listDatabases: 1,
171+
comment: { $$exists: false }
170172
}
171173
}
172174
}

test/integration/enumerate_indexes.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ const testSuite = new UnifiedTestSuiteBuilder('listIndexes with comment option')
2424
events: [
2525
{
2626
commandStartedEvent: {
27-
command: {}
27+
command: {
28+
listIndexes: 'coll0',
29+
comment: { $$exists: false }
30+
}
2831
}
2932
}
3033
]

test/tools/unified-spec-runner/match.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,12 @@ export function specialCheck(
253253
} else if (isExistsOperator(expected)) {
254254
// $$exists
255255
const actualExists = actual !== undefined && actual !== null;
256-
expect((expected.$$exists && actualExists) || (!expected.$$exists && !actualExists)).to.be.true;
256+
expect(
257+
(expected.$$exists && actualExists) || (!expected.$$exists && !actualExists),
258+
`expected value at ${path.join('')} to not exist, but received ${JSON.stringify(
259+
actual
260+
)} instead`
261+
).to.be.true;
257262
} else {
258263
expect.fail(`Unknown special operator: ${JSON.stringify(expected)}`);
259264
}

0 commit comments

Comments
 (0)