Skip to content

feat: Add MongoDB 9 support - #10751

Open
ga262 wants to merge 9 commits into
parse-community:alphafrom
ga262:ci/add-mongodb-9
Open

ga262 wants to merge 9 commits into
parse-community:alphafrom
ga262:ci/add-mongodb-9

Conversation

@ga262

@ga262 ga262 commented Oct 5, 2026 •

Copy link
Copy Markdown

Issue

Closes: #10750

Approach

Adds MongoDB 9 support in a single PR: CI coverage, a driver that MongoDB lists as compatible with 9.0, and the test adjustments needed for the suite to pass on MongoDB 9.

CI and docs

  • Adds MongoDB 9.0.2 (replica set) to the check-mongo CI matrix and a test:mongodb:9.0.2 npm script.
  • Adds MongoDB 9 to the README badge and compatibility table.

Driver

  • Upgrades mongodb from 7.1.0 to 7.7.0. MongoDB's client compatibility table lists Node.js driver 7.6+ as fully compatible with MongoDB 9.0, 7.3 to 7.5 as partially compatible, and 7.1 as not tested.
  • Same major version, no API change for the storage adapter. Lockfile: bson 7.3.1 → 7.3.3, @mongodb-js/saslprep 1.4.12 → 1.6.0, and the nested mongodb@7.5.0 under mongodb-runner is deduplicated.

Specs
A full local run on MongoDB 9.0.2 (replica set) had 3 failures. All three are in specs that hardcode server behavior that changed in MongoDB 9. None of them comes from the driver upgrade: the same failures occur with driver 7.1.0.

  • MongoStorageAdapter find … maxTimeMS (×2): MongoDB 9 runs server-side JavaScript ($where) in a WASM engine. It still returns MaxTimeMSExpired (code 50), but with a different message, and its startup overhead of roughly 200 ms made a sleep(125) exceed a 250 ms limit. The specs now assert the error code instead of the message and use a 1000 ms limit with sleep(250) / sleep(2000). They also use async/expectAsync, because done.fail is not a function in the current Jasmine version.
  • MongoCollection lazy geo index creation: MongoDB 9 includes field=<name> again in the geoNear "no index" error; only 8.3 to 8.x omits it. The version ranges of the two specs and the related source comments are updated. Runtime behavior is unchanged: the adapter already handles both message formats.

Tests

  • Full suite on MongoDB 9.0.2: 4605 specs, the 3 failures above. These 3 are now fixed and no other spec fails.
  • MongoStorageAdapter.spec.js and MongoCollection.spec.js pass on every MongoDB version in the CI matrix: 7.0.16, 8.0.4, 8.3.4 and 9.0.2.

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

Summary by CodeRabbit

  • Documentation
    • The MongoDB compatibility overview now includes version 9, with 9.0.2 as the minimum version. End-of-life is listed as TBD, and Parse Server support is listed through version 11.x (2028).
  • Tests
    • Automated checks now cover MongoDB 9.0.2 in a replica-set configuration with Node.js 24.11.0, and a command is available to run the test suite against that MongoDB version. Test coverage also verifies MongoDB query timeouts and version-specific index error messages.

@parse-github-assistant

Copy link
Copy Markdown

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant Bot changed the title ci: add MongoDB 9 to test matrix ci: Add MongoDB 9 to test matrix Oct 5, 2026
@parse-github-assistant

Copy link
Copy Markdown

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 87889fa8-1358-4517-a7b4-a0bd88e1ba8e
📥 Commits

Reviewing files that changed from the base of the PR and between f83517e and e355549.

📒 Files selected for processing (1)
  • spec/MongoCollection.spec.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • spec/MongoCollection.spec.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The MongoDB Node.js driver is upgraded to 7.7.0. MongoDB-version-specific tests are updated. MongoDB 9.0.2 is added to the test command and CI matrix, and the README now lists MongoDB 9.

Changes

MongoDB 9 support

Layer / File(s) Summary
Driver and MongoDB behavior expectations
package.json, package-lock.json, src/Adapters/Storage/Mongo/MongoCollection.js, spec/MongoCollection.spec.js, spec/MongoStorageAdapter.spec.js
Upgrades the MongoDB driver from 7.1.0 to 7.7.0 and updates its recorded dependency resolutions. Limits the geo-index error-message expectation to MongoDB 8.3 through 8.x. Updates the maxTimeMS tests to use async assertions and check the timeout error code and name.
MongoDB 9 test coverage
package.json, .github/workflows/ci.yml
Adds an npm script for tests with MongoDB 9.0.2 and a CI matrix case using a replica set and Node.js 24.11.0.
MongoDB compatibility information
README.md
Updates the MongoDB badge to list versions 7, 8, and 9. Adds version 9 to the compatibility table, with minimum version 9.0.2, end-of-life marked TBD, and Parse Server support through 11.x (2028).

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk

Merge Risk: ⚪ Minimal · up to e3555

No demonstrated issue currently blocks this MongoDB 9 compatibility change; it is mergeable after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to b8850

The update affects database and file-storage operations, but the compared application code does not add database authority or weaken query controls. Remaining uncertainty concerns the upgraded driver's runtime behavior, rather than an identified security regression.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A driver-level regression could affect database queries and GridFS operations performed with existing service credentials. The comparison shows shared dependency exposure, but no expansion of credential authority, tenant reachability, or network access.

Trust Boundaries and Controls

  • observed — The inspected caller chain retains application-level read authorization and query validation before database execution. The driver upgrade does not move those controls into the driver or add a user-facing bypass around them.

Resilience and Maintainability Implications

  • observed — The existing geo-index recovery path remains bounded to one retry, preserving projection and timeout options. Concurrent index creation, interrupted operations, and recovery semantics remain delegated to MongoDB and the driver; their behavior under the upgraded version was not runtime-verified.
🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Title check ✅ Passed The title begins with the required feat: prefix and clearly describes the MongoDB 9 support changes.
Description check ✅ Passed The description includes the issue, approach, implementation details, testing results, and completed documentation and test tasks. It omits the template's standard Pull Request security and license se…
Linked Issues check ✅ Passed Issue #10750 requires MongoDB 9.0.2 CI coverage, README compatibility documentation, the mongodb driver upgrade to 7.7.0, and updates for MongoDB 9 behavior changes. The changes add MongoDB 9.0.2 wi…
Out of Scope Changes check ✅ Passed The changes stay within issue #10750. The CI, README, dependency, lockfile, specification, and source-comment changes support MongoDB 9 compatibility. No unrelated change is demonstrated.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Security Check ✅ Passed No security vulnerability is introduced by the reviewed changes. Production MongoDB code changes only comments; the query and index logic is unchanged. The new CI and npm values are fixed version stri…
Engage In Review Feedback ✅ Passed No review feedback comments were present. The supplied review data reports zero actionable findings and no CodeRabbit review threads, so there was no feedback to ignore or resolve without engagement.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 5, 2026
Comment thread README.md Outdated
Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 5, 2026
ga262 and others added 2 commits October 7, 2026 16:10
MongoDB's client compatibility tables list Node.js driver 7.6+ as fully
compatible with MongoDB 9.0; 7.1.0 is not tested against 9.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- maxTimeMS specs assert the error code instead of the message, which
  differs on MongoDB 9, and use a wider time margin to absorb the startup
  overhead of the WASM engine that runs server-side JavaScript on MongoDB 9.
- The geoNear "no index" error includes the field name again on MongoDB 9;
  only MongoDB 8.3 to 8.x omits it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ga262 ga262 changed the title ci: Add MongoDB 9 to test matrix feat: Add MongoDB 9 support Oct 7, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 7, 2026
@ga262

ga262 commented Oct 7, 2026

Copy link
Copy Markdown
Author

@mtrezza MongoDB 9 support is now consolidated in this PR, as you suggested: CI matrix + docs, driver upgrade to mongodb@7.7.0 (first fully compatible range for MongoDB 9.0), and the spec adjustments needed for the suite to pass on 9.0. #10754 and #10755 are closed.

The PR is ready for review. Could you approve the CI workflows? They haven't run yet on this PR.

Comment thread spec/MongoCollection.spec.js Outdated
Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Add MongoDB 9 support

2 participants