From 213009271ab66ce6ec846462db0db0afe0f068dd Mon Sep 17 00:00:00 2001 From: shengchenyang <15538221825@163.com> Date: Sat, 19 Oct 2024 11:53:51 +0800 Subject: [PATCH] chore: display parameters explicitly --- ayugespidertools/common/mongodbpipe.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ayugespidertools/common/mongodbpipe.py b/ayugespidertools/common/mongodbpipe.py index 75440a2..069f5b9 100644 --- a/ayugespidertools/common/mongodbpipe.py +++ b/ayugespidertools/common/mongodbpipe.py @@ -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 @@ -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(