-
Notifications
You must be signed in to change notification settings - Fork 137
chore: merge list-search-indexes into collection-indexes #654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Merge functionality of the former list-search-indexes tool into collection-indexes, consolidating index (regular + search/vector) reporting behind a single tool.
- Remove list-search-indexes tool and its tests; extend collection-indexes tool to also retrieve search and vector search indexes (behind feature flag and search support check).
- Update integration and accuracy tests to reflect merged behavior, including scenarios with/without voyage API key and queryable search indexes.
- Adjust tooling registry to drop the removed tool.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
tests/integration/tools/mongodb/search/listSearchIndexes.test.ts | Removed obsolete integration tests for deprecated list-search-indexes tool. |
tests/integration/tools/mongodb/read/collectionIndexes.test.ts | Expanded tests to cover regular, search, and vector search indexes plus feature flag / API key scenarios. |
tests/integration/tools/mongodb/create/createIndex.test.ts | Minor config simplification for user config object. |
tests/accuracy/listSearchIndexes.test.ts | Removed accuracy tests for deprecated tool. |
tests/accuracy/collectionIndexes.test.ts | Added accuracy prompts formerly covered by list-search-indexes. |
src/tools/mongodb/tools.ts | Removed registration of deprecated ListSearchIndexesTool. |
src/tools/mongodb/search/listSearchIndexes.ts | Deleted deprecated tool implementation. |
src/tools/mongodb/metadata/collectionIndexes.ts | Added search/vector index extraction and combined output formatting. |
...formatUntrustedData( | ||
`Found ${indexDefinitions.length} indexes in the collection "${collection}":`, | ||
indexDefinitions.length > 0 ? JSON.stringify(indexDefinitions, null, 2) : undefined | ||
), | ||
...(searchIndexDefinitions.length > 0 | ||
? formatUntrustedData( | ||
`Found ${searchIndexDefinitions.length} search and vector search indexes in the collection "${collection}":`, | ||
JSON.stringify(searchIndexDefinitions, null, 2) | ||
) | ||
: []), |
Copilot
AI
Oct 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous list-search-indexes tool serialized index data with EJSON to preserve extended BSON types; switching to JSON.stringify may lose fidelity (e.g., ObjectId, Date) in future index definitions. Recommend importing EJSON from bson and using EJSON.stringify(..., { relaxed: false })
for both sets to maintain consistency and prevent data loss.
Copilot uses AI. Check for mistakes.
await provider.createIndexes(integration.randomDbName(), "foo", [{ key: { foo: 1 } }]); | ||
}); | ||
|
||
it("returns an just the regular indexes", async () => { |
Copilot
AI
Oct 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct grammar by removing "an": change to "returns just the regular indexes".
it("returns an just the regular indexes", async () => { | |
it("returns just the regular indexes", async () => { |
Copilot uses AI. Check for mistakes.
📊 Accuracy Test Results📈 Summary
📊 Baseline Comparison
📎 Download Full HTML Report - Look for the Report generated on: 10/15/2025, 4:34:06 PM |
Proposed changes
Checklist