Skip to content

Conversation

@h3n4l
Copy link
Member

@h3n4l h3n4l commented Jan 19, 2026

Summary

  • Add db.getCollectionInfos() support to MongoDB shell parser
  • Supports optional filter and options arguments: db.getCollectionInfos(), db.getCollectionInfos({ name: "users" }), db.getCollectionInfos({}, { nameOnly: true })
  • Part of MongoDB parser milestone 1

Test plan

  • Added test cases for db.getCollectionInfos() variants
  • All existing tests pass (197 test cases)

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings January 19, 2026 03:56
@h3n4l h3n4l enabled auto-merge (squash) January 19, 2026 03:57
@h3n4l h3n4l merged commit 76308b5 into main Jan 19, 2026
9 checks passed
@h3n4l h3n4l deleted the vk/1191-mongodb-parser-m branch January 19, 2026 03:57
Copy link

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 pull request adds support for db.getCollectionInfos() to the MongoDB shell parser, enabling the parser to recognize this MongoDB method with optional filter and options arguments.

Changes:

  • Added a new lexer token GET_COLLECTION_INFOS for the getCollectionInfos keyword
  • Added a new grammar rule getCollectionInfos in the parser to support zero, one, or two arguments
  • Updated all generated parser and lexer files (visitor, listener, base implementations) to include the new rule

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
mongodb/MongoShellLexer.g4 Added GET_COLLECTION_INFOS token definition
mongodb/MongoShellParser.g4 Added getCollectionInfos production rule with optional arguments support
mongodb/mongoshell_lexer.go Generated lexer with new token constants and lexer rules
mongodb/mongoshell_parser.go Generated parser with new context, visitor methods, and parsing logic
mongodb/mongoshellparser_visitor.go Added VisitGetCollectionInfos method to visitor interface
mongodb/mongoshellparser_listener.go Added Enter/Exit methods for getCollectionInfos production
mongodb/mongoshellparser_base_visitor.go Added base implementation of VisitGetCollectionInfos
mongodb/mongoshellparser_base_listener.go Added base implementation of Enter/Exit for getCollectionInfos
mongodb/parser_test.go Added three test cases covering different argument scenarios

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

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.

2 participants