• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mongodb-js / mongodb-mcp-server / 14637601756

24 Apr 2025 08:57AM UTC coverage: 42.737% (-32.7%) from 75.474%
14637601756

Pull #103

github

fmenezes
fix: rename describes
Pull Request #103: refactor: split test helpers

30 of 187 branches covered (16.04%)

Branch coverage included in aggregate %.

376 of 763 relevant lines covered (49.28%)

1.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

54.55
/src/tools/mongodb/delete/dropCollection.ts
1
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
2
import { DbOperationArgs, MongoDBToolBase } from "../mongodbTool.js";
1✔
3
import { ToolArgs, OperationType } from "../../tool.js";
4

5
export class DropCollectionTool extends MongoDBToolBase {
1✔
6
    protected name = "drop-collection";
2✔
7
    protected description =
8
        "Removes a collection or view from the database. The method also removes any indexes associated with the dropped collection.";
2✔
9
    protected argsShape = {
2✔
10
        ...DbOperationArgs,
11
    };
12
    protected operationType: OperationType = "delete";
2✔
13

14
    protected async execute({ database, collection }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
15
        const provider = await this.ensureConnected();
×
16
        const result = await provider.dropCollection(database, collection);
×
17

18
        return {
×
19
            content: [
20
                {
21
                    text: `${result ? "Successfully dropped" : "Failed to drop"} collection "${collection}" from database "${database}"`,
×
22
                    type: "text",
23
                },
24
            ],
25
        };
26
    }
27
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc