diff --git a/mongoSaver.py b/mongoSaver.py index d86af4c..dd4a9df 100644 --- a/mongoSaver.py +++ b/mongoSaver.py @@ -33,5 +33,25 @@ def save_csv_to_mongo(self, collection_name, csv_path): except Exception as e: print(e) + def delete_all(self): + # Access the desired database + database = self.client[DB_NAME] + + # Access the collection + collection = database["crns"] + + # Delete all documents in the collection + collection.delete_many({}) + + # Access the collection + collection = database["courses"] + + # Delete all documents in the collection + collection.delete_many({}) + + print("Deleted all documents in Courses and Crns") + + + def close_mongo_connection(self): self.client.close() \ No newline at end of file