Skip to content

Aggify 1.0: async-first MongoDB ODM rewrite (no MongoEngine) - #154

Merged
mohamadkhoshnava merged 5 commits into
mainfrom
rewrite/v1
Oct 17, 2026
Merged

mohamadkhoshnava merged 5 commits into
mainfrom
rewrite/v1

Conversation

@mohamadkhoshnava

Copy link
Copy Markdown
Member

Complete rewrite of Aggify as a standalone async-first MongoDB ODM with a Django-style API.

  • Native sync + async on pymongo (MongoClient / AsyncMongoClient), no MongoEngine
  • Documents, typed fields, lazy immutable QuerySets, automatic joins, Q/F, expressions, update operators
  • Rebuilt immutable pipeline builder with all common stages
  • Transactions, signals, indexes, optimistic locking
  • Integrations: Pydantic, FastAPI, gRPC, Django (framework-agnostic core)
  • Security hardening (operator injection, regex, server-side JS, mass assignment, limits)
  • 482 tests (unit, integration on a replica set, Hypothesis differential), docs site, migration guides

See CHANGELOG.md and docs/migration/aggify-0.md for breaking changes.

🤖 Generated with Claude Code

mohamadkhoshnava and others added 4 commits October 17, 2026 21:07
Drop MongoEngine entirely. Aggify is now an ODM on pymongo's native
MongoClient / AsyncMongoClient with a Django-style API.

- Documents, typed fields, Meta options, managers, signals, indexes,
  change tracking (save() sends only changed fields), optimistic locking
- Lazy immutable QuerySet with sync + async twins, automatic joins across
  references, Q/F, 25 lookups, values/annotate/aggregate, update operators
  and expression (pipeline) updates, bulk operations
- Immutable, schema-aware pipeline builder (Aggify) covering the common
  stages ($facet, $bucket, $setWindowFields, $graphLookup, $merge, ...)
- Transactions (ContextVar based), one async client per event loop
- Integrations: Pydantic, FastAPI, gRPC (grpc.aio), Django (app, forms,
  shortcuts, middleware, ObjectIdField for Django ORM models)
- Security: operator-injection prevention via typed fields, escaped regex
  lookups, server-side JS blocked, validated names, strict constructors,
  resource limits, masked credentials
- Tests: unit, integration against a real replica set, Hypothesis
  differential and security property tests, framework end-to-end tests
- Docs (mkdocs), cookbook, migration guides, Persian overview, CI, tox

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ot take args)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.87298% with 777 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.87%. Comparing base (1748e98) to head (dd59456).

Files with missing lines Patch % Lines
aggify/fields.py 77.25% 104 Missing and 52 partials ⚠️
aggify/queryset.py 82.96% 89 Missing and 51 partials ⚠️
aggify/expressions.py 80.42% 104 Missing and 35 partials ⚠️
aggify/pipeline.py 83.88% 56 Missing and 36 partials ⚠️
aggify/documents.py 87.65% 44 Missing and 24 partials ⚠️
aggify/contrib/django/forms.py 66.66% 17 Missing and 9 partials ⚠️
aggify/lookups.py 87.36% 14 Missing and 9 partials ⚠️
aggify/connection.py 87.42% 14 Missing and 6 partials ⚠️
aggify/schema.py 90.53% 10 Missing and 6 partials ⚠️
aggify/monitoring.py 81.25% 13 Missing and 2 partials ⚠️
... and 11 more

❗ There is a different number of reports uploaded between BASE (1748e98) and HEAD (dd59456). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (1748e98) HEAD (dd59456)
5 1
Additional details and impacted files
@@             Coverage Diff              @@
##              main     #154       +/-   ##
============================================
- Coverage   100.00%   83.87%   -16.13%     
============================================
  Files           12       29       +17     
  Lines         1087     4819     +3732     
  Branches         0      849      +849     
============================================
+ Hits          1087     4042     +2955     
- Misses           0      512      +512     
- Partials         0      265      +265     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mohamadkhoshnava
mohamadkhoshnava merged commit b9958ae into main Oct 17, 2026
13 of 15 checks passed
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.

1 participant