diff --git a/src/db/mongo_manager.py b/src/db/mongo_manager.py index c2e80e2..5dcc3da 100644 --- a/src/db/mongo_manager.py +++ b/src/db/mongo_manager.py @@ -77,7 +77,9 @@ class MongoDbManager: try: collection_to_use = self.db[CONTACT_LIST_TO_BOOK] for contact in contact_list: - collection_to_use.insert_one(contact.to_firestore_dict()) + # collection_to_use.insert_one(contact.to_firestore_dict()) + collection_to_use.replace_one(filter={'_id': contact.mail, }, replacement=contact.to_firestore_dict(), + upsert=True) except Exception as Error: self.logger.info(Error)