|
Statistics on a collection. The command name is "collStats" and the shell helper is database.collection.stats(). > db.commandHelp("collStats") help for: collStats { collStats:"blog.posts" , scale : 1 } scale divides sizes e.g. for KB use 1024 In the shell: > // to see params etc.: > db.foo.stats function (scale) { return this._db.runCommand({collstats:this._shortName, scale:scale}); } // to run: > db.foo.stats() { "ns" : "test.foo", "count" : 9, // number of documents "size" : 432, // collection size "avgObjSize" : 48, // average object size in bytes "storageSize" : 3840, // (pre)allocated space for the collection "numExtents" : 1, // extents are contiguously allocated // chunks of datafile space "nindexes" : 2, "lastExtentSize" : 3840, "paddingFactor" : 1, // padding can make updates faster // if documents grow "flags" : 1, "totalIndexSize" : 16384, "indexSizes" : { "_id_" : 8192, "x_1" : 8192 }, "ok" : 1 }
|

PLEASE POST QUESTIONS IN THE USER GROUPS FORUM. Post non-question comments and helpful hints here.
blog comments powered by Disqus