Skip to content

feat: add db.getCollectionInfos() operation support#7

Merged
d-bytebase merged 1 commit intomainfrom
vk/bd54-gomongo-mileston
Jan 19, 2026
Merged

feat: add db.getCollectionInfos() operation support#7
d-bytebase merged 1 commit intomainfrom
vk/bd54-gomongo-mileston

Conversation

@h3n4l
Copy link
Copy Markdown
Member

@h3n4l h3n4l commented Jan 19, 2026

Summary

  • Add support for db.getCollectionInfos() command
  • Returns collection metadata including name, type, options, and info fields
  • Supports optional filter argument: db.getCollectionInfos({ name: "users" })

Test plan

  • Integration tests added for basic usage, filtered query, and empty result
  • All existing tests pass
  • Linting clean

Generated with Claude Code

Add support for the db.getCollectionInfos() command which returns
collection metadata including name, type, options, and info fields.

Supports optional filter argument:
- db.getCollectionInfos()
- db.getCollectionInfos({ name: "users" })

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 19, 2026 05:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the db.getCollectionInfos() MongoDB shell command, which returns detailed metadata about collections in the database including name, type, options, and info fields. The implementation supports an optional filter argument to query for specific collections.

Changes:

  • Added new operation type and parsing logic for getCollectionInfos() with optional filter support
  • Implemented execution logic using MongoDB's ListCollections API
  • Added comprehensive integration tests covering basic usage, filtered queries, and empty results

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
translator.go Added operation type constant, visitor method, and argument extraction logic for getCollectionInfos()
executor.go Implemented execution logic that calls ListCollections with optional filter and formats results as Extended JSON
executor_test.go Added three integration tests covering unfiltered queries, filtered queries, and empty results
go.mod Updated parser dependency to version with GetCollectionInfosContext support
go.sum Updated checksums for the new parser dependency version

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread translator.go
@d-bytebase d-bytebase merged commit ca4b083 into main Jan 19, 2026
8 checks passed
@d-bytebase d-bytebase deleted the vk/bd54-gomongo-mileston branch January 19, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants