-
Notifications
You must be signed in to change notification settings - Fork 0
feat: M1 robustness - extended options support #14
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
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
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
Summary
Supported Options by Method
Cursor Modifier Methods
Test plan
🤖 Generated with Claude Code