Home > Database > Mysql Tutorial > mongodb 查看数据库和表大小

mongodb 查看数据库和表大小

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:33:05
Original
1473 people have browsed it

mongodb查看数据库和表的方法比较简单,在为这里推荐使用stats的方法,直观并且详细。 1,查看数据库 db.stats();{ "db" : "test", //当前数据库 "collections" : 3, //当前数据库多少表 "objects" : 4, //当前数据库所有表多少条数据 "avgObjSize" : 51, //

mongodb查看数据库和表的方法比较简单,在为这里推荐使用stats的方法,直观并且详细。

1,查看数据库

> db.stats();
{
    "db" : "test",               //当前数据库
    "collections" : 3,           //当前数据库多少表
    "objects" : 4,               //当前数据库所有表多少条数据
    "avgObjSize" : 51,           //每条数据的平均大小
    "dataSize" : 204,            //所有数据的总大小
    "storageSize" : 16384,       //所有数据占的磁盘大小
    "numExtents" : 3,
    "indexes" : 1,               //索引数
    "indexSize" : 8176,          //索引大小
    "fileSize" : 201326592,      //预分配给数据库的文件大小
    "nsSizeMB" : 16,
    "dataFileVersion" : {
        "major" : 4,
        "minor" : 5
    },
    "ok" : 1
}
Copy after login

2,查看数据库表

> db.posts.stats();
{
    "ns" : "test.posts",
    "count" : 1,
    "size" : 56,
    "avgObjSize" : 56,
    "storageSize" : 8192,
    "numExtents" : 1,
    "nindexes" : 1,
    "lastExtentSize" : 8192,
    "paddingFactor" : 1,
    "systemFlags" : 1,
    "userFlags" : 0,
    "totalIndexSize" : 8176,
    "indexSizes" : {
        "_id_" : 8176
    },
    "ok" : 1
}
Copy after login
mongodb 查看数据库和表大小 mongodb查看数据库和表的方法比较简单,在为这里推荐使用stats的方法,直观并且详细。 1,查看数据库 > db.stats(); { "db" : "test", //当前数据库 "collections" : 3, //当前数据库多少表 "objects" : 4, [...]mongodb 查看数据库和表大小
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
mongodb start
From 1970-01-01 08:00:00
0
0
0
linux - ubuntu14 error installing mongodb
From 1970-01-01 08:00:00
0
0
0
Use of symfony2 mongodb
From 1970-01-01 08:00:00
0
0
0
mongodb _id rename
From 1970-01-01 08:00:00
0
0
0
Parameter understanding of mongodb
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template