Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions mongoSaver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()