Skip to content

Commit fe53d4f

Browse files
committed
fix more tests
1 parent 97576ab commit fe53d4f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/tools/mongodb/metadata/explain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class ExplainTool extends MongoDBToolBase {
1616
...DbOperationArgs,
1717
method: z
1818
.array(
19-
z.union([
19+
z.discriminatedUnion("name", [
2020
z.object({
2121
name: z.literal("aggregate"),
2222
arguments: z.object(AggregateArgs),

src/tools/mongodb/read/aggregate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { EJSON } from "bson";
66
import { checkIndexUsage } from "../../../helpers/indexCheck.js";
77

88
export const AggregateArgs = {
9-
pipeline: z.array(z.record(z.string(), z.unknown())).describe("An array of aggregation stages to execute"),
9+
pipeline: z.array(z.object({}).passthrough()).describe("An array of aggregation stages to execute"),
1010
};
1111

1212
export class AggregateTool extends MongoDBToolBase {

tests/accuracy/explain.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describeAccuracyTests([
2727
],
2828
},
2929
{
30-
prompt: `Will fetching documents, where release_year is 2020, from 'mflix.movies' namespace perform a collection scan?`,
30+
prompt: `Will aggregating documents, where release_year is 2020, from 'mflix.movies' namespace perform a collection scan?`,
3131
expectedToolCalls: [
3232
{
3333
toolName: "explain",
@@ -51,7 +51,7 @@ describeAccuracyTests([
5151
],
5252
},
5353
{
54-
prompt: `Will fetching documents, where release_year is 2020, from 'mflix.movies' namespace perform a collection scan?`,
54+
prompt: `Will counting documents, where release_year is 2020, from 'mflix.movies' namespace perform a collection scan?`,
5555
expectedToolCalls: [
5656
{
5757
toolName: "explain",

0 commit comments

Comments
 (0)