feat: M1 robustness - extended options support#14
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request extends M1 (Milestone 1) MongoDB operations with robust options support and improved error handling for unsupported features.
Changes:
- Introduces new error types (UnsupportedOptionError, PlannedOperationError) to distinguish between unsupported options and planned-but-unimplemented operations
- Extends find()/findOne() to support projection as 2nd argument and options (hint, max, min, maxTimeMS) as 3rd argument
- Adds options support to aggregate(), countDocuments(), estimatedDocumentCount(), distinct(), and getCollectionInfos() with proper validation
- Implements cursor modifier methods: hint(), max(), min()
- Simplifies method registry to only track planned (M2/M3) operations
- Updates dependency to newer parser version
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| errors.go | Adds UnsupportedOptionError and PlannedOperationError types; removes DeprecatedOperationError; simplifies error messages |
| translator.go | Extends mongoOperation struct with new option fields; refactors extraction functions to handle multiple arguments and validate options; adds cursor method extractors |
| method_registry.go | Simplified to only contain 32 planned M2/M3 methods; removes deprecated/unsupported tracking; changes registry lookup logic |
| executor.go | Applies new options to MongoDB driver calls; adds maxTimeMS handling |
| executor_test.go | Comprehensive tests for all new options and error cases; updates existing test expectations |
| go.mod/go.sum | Updates parser dependency version |
| docs/plans/*.md | Design and implementation documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5af8c86 to
0b1100b
Compare
Extend M1 methods to support additional arguments and commonly used options: - Add UnsupportedOptionError type for unsupported options in supported methods - find()/findOne(): support projection (2nd arg) and options (3rd arg) - Options: hint, max, min, maxTimeMS - aggregate(): support options (2nd arg) - Options: hint, maxTimeMS - countDocuments(): add maxTimeMS support and option validation - estimatedDocumentCount(): add maxTimeMS support - distinct(): add maxTimeMS support (3rd arg) - getCollectionInfos(): add options support (2nd arg) - Options: nameOnly, authorizedCollections - Add cursor modifier methods: hint(), max(), min() Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0b1100b to
46b0df4
Compare
rebelice
approved these changes
Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supported Options by Method
Cursor Modifier Methods
Test plan
🤖 Generated with Claude Code