State information for MongoDB databases and collections

Source: Internet
Author: User

View database statistics: db.stats ()

 > use test
switched to DB Test
> Db.stats ()
{
        "DB" : "Test",
        "collections": 6, ,
        "Objects": 3149516,
        "avgobjsize": 71.99159362898935, ,
        "datasize": 226738676 ,
        "storagesize": 377942016,
        "numextents": +,
        "Indexes": 5,
        "indexsize": 102535216,
        "FileSize": 2080374784,
        "NSSIZEMB":
        "Datafileversion" : {
                ' major ': 4,
                "Minor": 6
       },
        "OK": 1
}

Note: The return value is interpreted as follows:

"DB": Database name

"Collections": Number of collections
"Objects": Number of documents
"Avgobjsize": Average size of each document
"DataSize": Data footprint, excluding index, in bytes
"Storagesize": Allocated storage space, this value does not degrade when the collection or document is deleted

"Numextents": contiguous allocated blocks of data

"Indexes": Number of indexes
"Indexsize": Index occupy space size
"FileSize": the size of the physical storage file
"Nssizemb": namespace File Size
"Datafileversion": {
"Major": Data file Major version number
"Minor": Minor version number
},

Collection Statistics: db.collection.stats ()

> Db. User.stats ()
{
        "ns": "Test. User,
        "Count": 3149352,
        "size": 226727736,
  &NBS P     "Avgobjsize": 71.9918688034872,
        "storagesize": 377905152,
        "numextents": +,
        "nindexes": 2,
        "Lastexten Tsize ": 104161280,
       " Paddingfactor ": 1.0000000000000004,
       " s Ystemflags ": 0,
       " UserFlags ": 0,
       " totalindexsize ": 1817443
        "indexsizes": {
                "_id_": 10 2502512,
                "age_1": 79241792
       },        "OK": 1
}

Note: The return value is interpreted as follows:
"NS": namespace

"Count": Number of documents

' Size ': Data footprint in the collection, excluding indexes
"Avgobjsize": Average size of each document
"Storagesize": Allocated storage space, this value does not degrade when the document in the collection is deleted
"Numextents": contiguous allocated blocks of data
"Nindexes": Number of indexes

"Lastextentsize": the size of the most recently allocated block

"Paddingfactor": Fill factor

"Systemflags": Unknown

"UserFlags": Unknown

"Totalindexsize": Index occupies total space size

"Indexsizes": {
"_ID_": ID column index occupies space size
"Age_1": Age column occupies space size
},

from:http://blog.csdn.net/seteor/article/details/11601273

State information for MongoDB databases and collections

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.