其他分享
首页 > 其他分享> > mongo笔记

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")

 

标签:collstats,statistics,mongo,db,笔记,client,command,print
来源: https://www.cnblogs.com/buxizhizhoum/p/14982095.html