Update index.py

This commit is contained in:
Mr Chen
2024-05-04 16:24:57 +08:00
parent 76ec5b58cd
commit 367aeddd2d
+9 -1
View File
@@ -732,7 +732,15 @@ def getDbInfo():
db_name = args['name']
db = client[db_name]
result = db.command("dbStats")
result = {}
t = db.command("dbStats")
# print(result)
result['collections'] = t['collections']
result['avgObjSize'] = t['avgObjSize']
result['dataSize'] = t['dataSize']
result['storageSize'] = t['storageSize']
result['indexSize'] = t['indexSize']
result["collection_list"] = []
for collection_name in db.list_collection_names():
collection = db.command("collStats", collection_name)