Is there a way to use db.collection.stats() to return only 4 selected columns (ns, count, size, storageSize) in a single output line?
> db.author.stats().ns; <-- this returns the 1 feild
> db.author.stats(); <-- this returns all
{
"ns" : "cse.author",
"count" : 376,
"size" : 624768,
"avgObjSize" : 1661,
"storageSize" : 696320,
"numExtents" : 4,
"nindexes" : 4,
"lastExtentSize" : 524288,
"paddingFactor" : 1,
"systemFlags" : 1,
"userFlags" : 1,
"totalIndexSize" : 122640,
"indexSizes" : {
"_id_" : 24528,
"last_name_1" : 24528,
"events.date_1" : 24528,
"first_name_text_last_name_text" : 49056
},
"ok" : 1
I'm not sure the syntax of getting multiple selected fields. I appreciate any assistance.
Thanks,
Tony