Skip to content

Commit

Permalink
replace Encoder with get_dict in the replace_one method (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-right authored Oct 15, 2023
1 parent ef8e6a1 commit 4bdac58
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion beanie/odm/queries/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,12 @@ async def replace_one(
Operation(
operation=ReplaceOne,
first_query=self.get_filter_query(),
second_query=Encoder(exclude={"_id"}).encode(document),
second_query=get_dict(
document,
to_db=True,
exclude={"_id"},
keep_nulls=document.get_settings().keep_nulls,
),
object_class=self.document_model,
pymongo_kwargs=self.pymongo_kwargs,
)
Expand Down

0 comments on commit 4bdac58

Please sign in to comment.