# MongoEngine/mongoengine

A Python Object-Document-Mapper for working with MongoDB

Repository: https://github.com/MongoEngine/mongoengine
Canonical: https://ross.abutalabs.com/products/mongoengine
Homepage: https://mongoengine-odm.readthedocs.io
Language: Python
License: MIT
License Family: permissive
Topics: python, mongodb, mongodb-orm, mongo, pymongo, orm, odm, hacktoberfest
Last push: 2026-08-24T09:42:30+00:00

## Health v2 (maintenance only)
Score: 79/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 42, longevity 100
- inputs: {"age_days": 5294, "days_push": 9, "days_rel": 176, "gap_med": 268.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4348, forks 1230 (observed 2026-08-28T04:08:46.253629+00:00)

## What it is
MongoEngine is a Python Object-Document Mapper (ODM) built on top of PyMongo for working with MongoDB. It provides schema-based document models, querying, signals, and file storage in a declarative, ORM-like API.

## Use cases
- model MongoDB documents with Python classes
- query MongoDB with a pythonic API instead of raw queries
- add schema validation to a schemaless MongoDB database
- use MongoDB as the data layer for a Django or Flask app
- store and retrieve files with GridFS from Python
- define document fields with types, defaults, and required validation

## When to choose
- you use MongoDB from Python and want structured, validated document models
- you prefer declarative schemas and queryset APIs over raw PyMongo calls
- you want a mature, MIT-licensed ODM with Django integration support

## When to avoid
- you use a relational database instead of MongoDB
- you need maximum performance and minimal abstraction - use PyMongo directly
- you need an async-first ODM for asyncio applications

## Facets
- artifact type: library
- maturity: stable
- function: orm, database-driver, database, data-science
- domain: databases, backend, web-development, developer-tools
- platform: python, cross-platform
- tags: mongodb, odm, pymongo, document-mapper, schema-modeling

## Member repositories
- MongoEngine/mongoengine (main) score 79

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:46.253629+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:21:33.424343+00:00, confidence not recorded.
  - readme: https://github.com/MongoEngine/mongoengine (fetched 2026-08-28T04:08:46.253629+00:00, sha 8d3f9c9e7951)
  - homepage: https://mongoengine-odm.readthedocs.io (fetched 2026-08-29T09:10:31.012641+00:00, sha 5ca633c8313b)
  - registry_pypi: https://pypi.org/pypi/mongoengine/json (fetched 2026-08-29T09:10:31.015334+00:00, sha 7ab847be20c3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
