Skip to content

Commit

Permalink
chore: display parameters explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
shengchenyang committed Oct 19, 2024
1 parent 8af915f commit 2130092
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ayugespidertools/common/mongodbpipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ def _default_storage(
db[collection_name].insert(insert_data)
else:
db[collection_name].update(
item_dict["_mongo_update_rule"], {"$set": insert_data}, True
item_dict["_mongo_update_rule"], {"$set": insert_data}, upsert=True
)
else:
if not item_dict.get("_mongo_update_rule"):
db[collection_name].insert_one(insert_data)
else:
db[collection_name].update_one(
item_dict["_mongo_update_rule"], {"$set": insert_data}, True
item_dict["_mongo_update_rule"], {"$set": insert_data}, upsert=True
)

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

async def process_item_template(
Expand Down

0 comments on commit 2130092

Please sign in to comment.