MongoDB 集合(Collection)对应的物理文件

dbpath下是清一色的collection-n-***与index-n-***开头的物理文件,如何知道某一个集合与其对应与其对应的物理文件? 

db.collection_name.stats()
返回的结果包含集合数据对应的物理文件
db.collection_name.stats({indexDetails:true})
返回的结果包含集合数据和索引对应的物理文件

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

猜你喜欢

转载自www.cnblogs.com/wy123/p/10039966.html