Skip to content

[FR] MongoEngine support #3335

Open

Description

@rchen152

Describe the Bug

Context: #3232

We have a user request for support for MongoEngine. Typing-wise, this seems pretty similar to Django. More details here, but essentially, it looks like models (classes) need some dataclass-like features like a generated __init__ and synthesized fields (id, pk, objects).

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Activity

  1. added
    needs-discussionAn issue where it's not clear whether there is a bug or we are behaving as expected.
    on May 7, 2026
  2. rchen152 commented on May 7, 2026

    @rchen152
    ContributorAuthor

    @migeed-z would love to get your thoughts on this

  3. migeed-z commented on May 9, 2026

    @migeed-z
    Contributor

    I think this is great to discuss! At some point when I added factory-boy support, @samwgoldman made a point which is that we've now got special-case logic for Django, Pydantic, Attrs and Marshmallow. Then we added factory-boy. MongoEngine would be six. Each one is individually quite reasonable, but the trend deserves thinking, especially because there will be maintenance cost, I will anticipate there will be versioning issues etc.

    Some questions I have:

    1. Who are we unblocking with MongoEngine support?
    2. What's the ongoing cost?

    I think that if there is high demand and we can indeed block a large number of users, then perhaps now is also the time to look into a longer-term solution?

    Concretely, I know @rchen152 you made some points about investing in our internal architecture for these integrations. Perhaps some kind of API or shared framework for adding and maintaining 3p library support, rather than each one being a bespoke code path?

    Today every new library lands as its own special case, which is what makes the maintenance and versioning cost scale linearly with the number of libraries we support. If we can refactor toward a common extension point, the cost of saying "yes" to the next library would be lower and we'd be in a much better position to keep up with version drift.

    WDYT?

  4. rchen152 commented on May 12, 2026

    @rchen152
    ContributorAuthor

    Agreed, it would be better to design a longer-term solution rather than adding more bespoke code paths. Perhaps MongoEngine support could be a good motivating use case for thinking about how to refactor so that Django and MongoEngine can share the same integration points.

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

    needs-discussionAn issue where it's not clear whether there is a bug or we are behaving as expected.typechecking

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions