Skip to content

Commit 211d3a3

Browse files
committed
chore: Fix linting issues and simplify
1 parent 2816bba commit 211d3a3

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

src/tools/args.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ function toEJSON<T extends object | undefined>(value: T): T {
7878
return EJSON.deserialize(value, { relaxed: false }) as T;
7979
}
8080

81-
export const zEJSON = () => z.object({}).passthrough().transform(toEJSON);
81+
export const zEJSON = z.object({}).passthrough().transform(toEJSON);

src/tools/mongodb/create/insertMany.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class InsertManyTool extends MongoDBToolBase {
1010
protected argsShape = {
1111
...DbOperationArgs,
1212
documents: z
13-
.array(zEJSON().describe("An individual MongoDB document"))
13+
.array(zEJSON.describe("An individual MongoDB document"))
1414
.describe(
1515
"The array of documents to insert, matching the syntax of the document argument of db.collection.insertMany()"
1616
),

src/tools/mongodb/delete/deleteMany.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class DeleteManyTool extends MongoDBToolBase {
1010
protected description = "Removes all documents that match the filter from a MongoDB collection";
1111
protected argsShape = {
1212
...DbOperationArgs,
13-
filter: zEJSON()
13+
filter: zEJSON
1414
.optional()
1515
.describe(
1616
"The query filter, specifying the deletion criteria. Matches the syntax of the filter argument of db.collection.deleteMany()"

src/tools/mongodb/read/aggregate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ErrorCodes, MongoDBError } from "../../../common/errors.js";
99
import { zEJSON } from "../../args.js";
1010

1111
export const AggregateArgs = {
12-
pipeline: z.array(zEJSON()).describe("An array of aggregation stages to execute"),
12+
pipeline: z.array(zEJSON).describe("An array of aggregation stages to execute"),
1313
};
1414

1515
export class AggregateTool extends MongoDBToolBase {

src/tools/mongodb/read/count.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { checkIndexUsage } from "../../../helpers/indexCheck.js";
55
import { zEJSON } from "../../args.js";
66

77
export const CountArgs = {
8-
query: zEJSON()
8+
query: zEJSON
99
.optional()
1010
.describe(
1111
"A filter/query parameter. Allows users to filter the documents to count. Matches the syntax of the filter argument of db.collection.count()."

src/tools/mongodb/read/find.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { EJSON } from "bson";
99
import { zEJSON } from "../../args.js";
1010

1111
export const FindArgs = {
12-
filter: zEJSON()
12+
filter: zEJSON
1313
.optional()
1414
.describe("The query filter, matching the syntax of the query argument of db.collection.find()"),
1515
projection: z

src/tools/mongodb/update/updateMany.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export class UpdateManyTool extends MongoDBToolBase {
1010
protected description = "Updates all documents that match the specified filter for a collection";
1111
protected argsShape = {
1212
...DbOperationArgs,
13-
filter: zEJSON()
13+
filter: zEJSON
1414
.optional()
1515
.describe(
1616
"The selection criteria for the update, matching the syntax of the filter argument of db.collection.updateOne()"
1717
),
18-
update: zEJSON().describe(
18+
update: zEJSON.describe(
1919
"An update document describing the modifications to apply using update operator expressions"
2020
),
2121
upsert: z

0 commit comments

Comments
 (0)