--collection中的數據大小
db.collection.dataSize()
--爲collection分配的空間大小,包括未使用的空間
db.collection.storageSize()
--collection中索引數據大小
db.collection.totalIndexSize()
--collection中index+data所佔空間
db.collection.totalSize()
--查詢collection數據條數
> db.OrderLog201512.count();
2855915
--轉換爲MB
> db.OrderLog201512.totalSize()/1024/1024;
250.4375
--更加直觀
>print("TotalSize(MB)");db.OrderLog201512.totalSize()/1024/1024;
TotalSize(MB)
251.10546875