Skip to content

How to evolve? #948

Open
Open

Description

@engFelipeMonteiro

Discussion: Defining the best path forward for mongomock

Opening this discussion to define the best path forward for the library. In the last few days I've been working to accelerate the repository — closing the gap with upstream, modernizing CI/CD, and mapping out the remaining work.

Now that I've been invited as a maintainer of the mongomock repo, it's time to discuss strategy. My fork (mongomock-ng) is significantly ahead of upstream in features, CI, and modern Python/MongoDB support. Below is the full picture.

Current state of mongomock-ng vs upstream

  • Python >=3.10 (upstream: 3.9+, EOL Oct 2025)
  • MongoDB 7.0.34 CI (upstream: 5.0.5, EOL Oct 2024)
  • PyMongo 3 dropped, testing against specific 4.x minors
  • Automated publish on merge to develop (upstream: manual tag push)
  • AI-assisted development pipeline (LLM agents, .agents/references/ persistent memory, 9 specialized skills, opencode CLI)
  • 10+ upstream PRs already replicated via consolidated branches

Incompatibles changes

  • Drop pypy3 support, due numpy incompatibility
  • Versioning CI/CD

Activity

  1. rkingsbury commented on Jul 13, 2026

    @rkingsbury

    Hi @engFelipeMonteiro , it's great to see someone taking over active maintenance of mongomock ! I'm a maintainer of a package called maggma that relies pretty heavily on it, and switching to mongomock-ng allowed me to remove the old pymongo version pin.

    I'm just curious about your plans - is there anything preventing you from merging your mongomock-ng changes back into mongomock itself at this point?

  2. engFelipeMonteiro commented on Jul 23, 2026

    @engFelipeMonteiro
    CollaboratorAuthor

    Hi @rkingsbury — I've been actively developing a forward fork at mongomock-ng with MongoDB 7.0.34 CI, PyMongo 4.11+ support, and significant feature additions (geospatial, transactions, window functions, date operators, etc). Currently at v7.9.3 with 51+ tests.

    I'm planning to merge these changes upstream as MongoDB 7 API support. Would love feedback on the approach — specifically whether to:

    1. Merge incrementally (PR by PR)
    2. Release a major version (5.0.0) with the full feature set

    Also started a LinkedIn group to coordinate community feedback — you're welcome to join! All maintainers and contributors are invited.

    What's included

    • 13 upstream PRs already replicated and tested
    • Full geospatial: $geoIntersects, $geoWithin, $near, $nearSphere, $geoNear
    • Transaction support: ClientSession, start_transaction, commit_transaction
    • 20+ aggregation operators: $setWindowFields, $fill, $convert, $reduce, $merge, $unionWith, date operators, set operators, bitwise operators
    • QueryProfiler for query analysis
    • Document validation
    • MkDocs documentation site
    • Automated CI/CD publish on merge

    Current state

    upstream mongomock mongomock-ng
    Last release 4.2.0 (Sep 2024) 7.9.3 (Jul 2026)
    Python 3.9+ 3.10+
    MongoDB CI 5.0.5 7.0.34
    PyMongo 3+ 4.11+

    Remaining gaps

    • 9 window operators missing ($top, $bottom, $derivative, etc)
    • $range and unit window clause formats

    Looking forward to collaboration on the best path forward.

  3. rkingsbury commented on Aug 3, 2026

    @rkingsbury

    Thanks @engFelipeMonteiro ! I don't have a strong opinion about whether to go PR-by-PR or all at once. The latter approach will be less work for you of course :) Mainly, I just want to keep track of when / if I should switch maggma back to mongomock over mongomock-ng.

    Feature-wise, I'd say keeping relatively current with the MongoDB API support should be the main priority. In maggma, we rely mainly on straightforward methods bulk_write, aggregate, find etc. which are already well supported. If there are opportunities to improve their performance (e.g., by cython-izing, rewriting pieces in Rust or other means) that would be welcome, but I understand that may not be a high priority since I suspect most users employ mongomock for testing rather than primary functionality.

  4. mdomke commented on Nov 17, 2026

    @mdomke
    Member

    @engFelipeMonteiro I'd suggest adding the changes from your fork to this project and create a new major release. To save you the hassle of creating individual PRs you can also do a big-bang-integration. People have been desperately waiting for some development and I'm really happy to see that you have put significant work into this. However, the whole idea of seeking for new maintainers was to keep this project alive, rather than creating a new project on top of it. Thanks again for all the effort you put into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions