MongoDB Tutorial 20 : Administrative Commands

Get the collection statistics

db.<collectionName>.stats()
db.printCollectionStats()

Latency statistics for read, writes operations including average time taken for reads, writes and related umber of operations performed

db.<collectionName>.latencyStats()

Get collection size for data and indexes

db.<collectionName>.dataSize() // Size of the collection

db.<collectionName>.storageSize() // Total size of document stored in the collection
db.<collectionName>.totalSize() // Total size in bytes for both collection data and indexes
db.<collectionName>.totalIndexSize() // Total size of all indexes in the collection

List all the user

show users or db.getUsers()

Comments

Popular posts from this blog

Hive Tutorial 31 : Analytic Functions

Hive Tutorial 37 : Performance Tuning