Skip to content

Commit 6e5bd97

Browse files
committed
fix: tests
1 parent e4c7c03 commit 6e5bd97

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/tools/mongodb/read/aggregate.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export class AggregateTool extends MongoDBToolBase {
2828
// Check if aggregate operation uses an index if enabled
2929
if (this.config.indexCheck) {
3030
await checkIndexUsage(provider, database, collection, "aggregate", async () => {
31-
return provider.aggregate(database, collection, pipeline).explain("queryPlanner");
31+
return provider
32+
.aggregate(database, collection, pipeline, {}, { writeConcern: undefined })
33+
.explain("queryPlanner");
3234
});
3335
}
3436

tests/integration/indexCheck.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ describe("IndexCheck integration tests", () => {
191191
collection: "aggregate-test-collection",
192192
pipeline: [
193193
{ $match: { category: "A" } }, // Now has index
194-
{ $group: { _id: "$category", count: { $sum: 1 } } },
195194
],
196195
},
197196
});
@@ -308,7 +307,7 @@ describe("IndexCheck integration tests", () => {
308307
expect(response.isError).toBeFalsy();
309308
const content = getResponseContent(response.content);
310309
expect(content).toContain("Deleted");
311-
expect(content).toMatch(/\d+ document\(s\)/);
310+
expect(content).toMatch(/`\d+` document\(s\)/);
312311
});
313312
});
314313
},

0 commit comments

Comments
 (0)