Monday, 7 June 2021

Mongo shell: db.stats() : Get statistics about the database

Using ‘db.stats()’ method, you can get the statistics about the database.

> show databases;
admin   0.000GB
config  0.000GB
local   0.000GB
sample  0.000GB
> 
> 
> 
> use sample;
switched to db sample
> 
> 
> db.stats()
{
	"db" : "sample",
	"collections" : 3,
	"views" : 0,
	"objects" : 35,
	"avgObjSize" : 69.28571428571429,
	"dataSize" : 2425,
	"storageSize" : 81920,
	"indexes" : 3,
	"indexSize" : 81920,
	"totalSize" : 163840,
	"scaleFactor" : 1,
	"fsUsedSize" : 169472430080,
	"fsTotalSize" : 499963174912,
	"ok" : 1
}

 

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment