1
|
from Utilities.Database import database_loader
|
2
|
|
3
|
|
4
|
#TODO: smazat vsechny pomocny soubory po cisteni databaze + prejmenovat
|
5
|
def clean_database():
|
6
|
"""
|
7
|
Drops every collection in database
|
8
|
"""
|
9
|
# Creating connection
|
10
|
mydb = database_loader.create_database_connection()
|
11
|
|
12
|
# Retrieve list of all collections
|
13
|
collections = mydb.list_collection_names()
|
14
|
|
15
|
# Drop of all collections
|
16
|
for name in collections:
|
17
|
print(name)
|
18
|
mydb[name].drop()
|
19
|
|
20
|
|
21
|
print('Data z databáze budou smazána:')
|
22
|
clean_database()
|