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(