Skip to content

Commit

Permalink
refactor: change mongodb update rules
Browse files Browse the repository at this point in the history
  • Loading branch information
shengchenyang committed Oct 19, 2024
1 parent 6bbb622 commit 8af915f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ayugespidertools/common/mongodbpipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _default_storage(
if not item_dict.get("_mongo_update_rule"):
db[collection_name].insert_one(insert_data)
else:
db[collection_name].update_many(
db[collection_name].update_one(
item_dict["_mongo_update_rule"], {"$set": insert_data}, True
)

Expand Down Expand Up @@ -166,7 +166,7 @@ async def _data_storage_logic( # type: ignore[override]
if not item_dict.get("_mongo_update_rule"):
await db[collection_name].insert_one(insert_data)
else:
await db[collection_name].update_many(
await db[collection_name].update_one(
item_dict["_mongo_update_rule"], {"$set": insert_data}, True
)

Expand Down

0 comments on commit 8af915f

Please sign in to comment.