Skip to content

Commit

Permalink
Improve replace_with
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamadkhalaj committed Nov 8, 2023
1 parent 691e037 commit 42e49c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aggify/aggify.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,9 @@ def replace_with(
new_root = {"$replaceWith": name}
else:
new_root = {"$replaceWith": {"$mergeObjects": [merge, name]}}
self.base_model._fields.update( # noqa
{key: mongoengine_fields.IntField() for key, value in merge.items()}
)
self.pipelines.append(new_root)

return self
Expand Down

0 comments on commit 42e49c2

Please sign in to comment.