diff --git a/src/db/mongo_manager.py b/src/db/mongo_manager.py index 942fda1..01c72f8 100755 --- a/src/db/mongo_manager.py +++ b/src/db/mongo_manager.py @@ -78,7 +78,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)