mongo笔记

获取stats

from pymongo import MongoClient

client = MongoClient()
db = client.test

# print collection statistics
print db.command("collstats", "events")
print(db.command("collstats", "messages")["storageSize"])
# print database statistics print db.command("dbstats")
原文地址:https://www.cnblogs.com/buxizhizhoum/p/14982095.html