Skip to content

feat: add Mutation DSL for atomic bulk updates#32

Merged
tecnosam merged 3 commits into
mainfrom
fictional-objects/efficient-updates
Dec 27, 2025
Merged

feat: add Mutation DSL for atomic bulk updates#32
tecnosam merged 3 commits into
mainfrom
fictional-objects/efficient-updates

Conversation

@tecnosam
Copy link
Copy Markdown
Owner

Update

Introduces a Pythonic Mutation DSL that allows composing MongoDB atomic update operations ($set, $inc, $addToSet, $push, etc.) directly on field expressions.

Key features:

  • Bulk updates via .find(...).mutate() / .amutate() without loading documents into memory
  • Supports numeric ops (+=, *=, setmax/setmin), array ops (push, addToSet, pull, pop), nested fields, and unset
  • Automatically collects mutations in a per-query context

Includes:

  • MutationExpression & context management
  • FieldExpression extensions for mutation syntax
  • Safe usage patterns + warning about shared context
  • Updated docs (updates-from-mutations.md/txt)

This is the main feature enabling efficient bulk maintenance, counters, rewards, and migrations.

No breaking changes — existing document → .save() workflow remains fully supported.

@tecnosam tecnosam self-assigned this Dec 27, 2025
@tecnosam tecnosam merged commit e4210b0 into main Dec 27, 2025
5 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