indexes

Create, inspect, drop, and explain MongoDB indexes with JSON input.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/theslashdojo/dojo --skill indexes-theslashdojo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: indexes
Source: https://github.com/theslashdojo/dojo/tree/main/nodes/mongodb/indexes
Command: npx skills add https://github.com/theslashdojo/dojo --skill indexes-theslashdojo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mongodb, bson, and includes scripts (resource) components.

What problem does it solve?

Query performance, sort costs, and uniqueness guarantees in MongoDB often depend on correct index shape; this skill helps create, inspect, drop, and explain indexes so agents and developers can tune read latency and enforce constraints with confidence.

Core Features & Use Cases

  • Create single-field and compound indexes, including unique and TTL indexes, to match common filter and sort patterns.
  • List and drop obsolete indexes to reduce write amplification and storage overhead in high-write collections.
  • Explain query plans using execution statistics and optional hints so the agent can verify whether an index is used and iterate on index design.

Quick Start

Provide a MongoDB URI and an INDEX_INPUT_JSON payload describing database, collection, and action then run the manage-indexes script to create, list, drop, or explain indexes.

Frequently Asked Questions about indexes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a compound MongoDB index to speed up slow queries?

You can create a compound MongoDB index by providing a MongoDB URI and a JSON payload specifying the database, collection, and index keys. The skill creates single-field and compound indexes to match common filter and sort patterns, improving read latency.

How do I use explain with executionStats to verify if a MongoDB index is used?

You use the explain action with executionStats to inspect MongoDB query plans and execution statistics. This verifies whether a MongoDB index is used and helps iterate on index design by showing detailed execution metrics.

Can I automate dropping obsolete MongoDB indexes to reduce write amplification?

Yes, you can list and drop obsolete MongoDB indexes to reduce write amplification and storage overhead in high-write collections. Provide the target database and collection in the JSON payload to remove unwanted indexes.

Does this approach support creating TTL and unique constraints in MongoDB?

Yes, the index creation process supports TTL and unique constraints in MongoDB. You can enforce uniqueness guarantees and manage time-to-live indexes by specifying the appropriate options in the JSON input payload.

Can I use JSON or EJSON input to manage MongoDB indexes with node.js tooling?

Yes, the index management process accepts JSON and EJSON input for integration with node.js tooling. This allows automated workflows to create, inspect, drop, and explain MongoDB indexes using controlled index DDL.