-
Notifications
You must be signed in to change notification settings - Fork 0
add functions option to TypeScript types and test case for mongodb-js/mongoose-autopopulate#112 #2
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: master
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9508a84d5c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "eslint": "7.32.0", | ||
| "mocha": "5.1.1", | ||
| "mongoose": "9.0.0-rc1", | ||
| "mongoose": "git@github.com:Automattic/mongoose.git#vkarpov15/mongodb-js/mongoose-autopopulate#112", |
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.
Avoid SSH-only git URL for dev dependency
The devDependency switches mongoose to an SSH git URL (git@github.com:...). npm install will fail in any environment that doesn’t have a GitHub SSH key configured (common in CI and for new contributors), whereas the previous semver dependency was installable via the registry. If this is only for a temporary test of a branch, consider using an HTTPS git URL or a published version/commit to keep installs working broadly.
Useful? React with 👍 / 👎.
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 PR adds TypeScript type definitions for the functions option and includes a test case to verify that match functions work correctly in virtual populate scenarios with autopopulate.
Changes:
- Added test case for mongodb-jsgh-112 demonstrating that match functions in virtual populates work with autopopulate
- Added
AutopopulateOptionsinterface withfunctionsoption to TypeScript type definitions - Updated peerDependencies to accept Mongoose 9.x (removing pre-release constraint)
- Updated devDependencies to use a git branch reference for testing
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/bugs.test.js | Added comprehensive test case for virtual populate with match function (mongodb-jsgh-112) |
| package.json | Updated mongoose devDependency to git branch and modified peerDependencies semver range to support Mongoose 9.x |
| index.d.ts | Added TypeScript types for the functions plugin option including new type and interface definitions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "eslint": "7.32.0", | ||
| "mocha": "5.1.1", | ||
| "mongoose": "9.0.0-rc1", | ||
| "mongoose": "git@github.com:Automattic/mongoose.git#vkarpov15/mongodb-js/mongoose-autopopulate#112", |
Copilot
AI
Jan 25, 2026
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 git branch reference contains a '#' character which conflicts with git's URL syntax. Git URLs use '#' to separate the repository from the branch/ref (format: git@github.com:user/repo.git#branch). A branch name containing '#' will cause parsing issues. The branch name 'vkarpov15/mongodb-js#112' should be URL-encoded or use a different separator character (typically '/' is replaced with '-' in branch names).
| "mongoose": "git@github.com:Automattic/mongoose.git#vkarpov15/mongodb-js/mongoose-autopopulate#112", | |
| "mongoose": "git@github.com:Automattic/mongoose.git#vkarpov15/mongodb-js/mongoose-autopopulate%23112", |
functionsoption to types to fix Missing types for plugin configuration mongodb-js/mongoose-autopopulate#114