MongoDB 集合(Collection)對應的物理文件

dbpath下是清一色的collection-n-***與index-n-***開頭的物理文件,如何知道某一個集合與其對應與其對應的物理文件? mongodb

db.collection_name.stats()
返回的結果包含集合數據對應的物理文件
db.collection_name.stats({indexDetails:true})
返回的結果包含集合數據和索引對應的物理文件

官方有db.collection.stats用法的詳細信息:https://docs.mongodb.com/manual/reference/method/db.collection.stats/blog

 

相關文章
相關標籤/搜索