Mongodb – How to Check Capped Size Setting with Stats Command

mongodb

I am looking around my mongo instance. One of the collections was created as capped:

db.createCollection("userObjects", { capped:true, size:400000000000 })

But when I look at the db.userObjects.stats(), I don't see any flag that indicates it is capped, or the cap size.

Am I missing something? (Is there another place to look?)

Best Answer

If you connect to the proper DB and execute a db..stats() in the Mongo shell you will see "capped" : true third from the bottom of the output just after index sizes.

To figure out a collections cap size, you could use the system namespace.

e.g. db.system.namespaces.find({name : "."}, {"options.size":1})