I am playing around in the mongodb-shell
trying to learn about mongodb
, and noticed that db.stats()
shows number of collections to be 1 more than what is shown by db.getCollectionNames()
Here is the example:
> db.stats();
{
"db" : "learn",
"collections" : 6,
"objects" : 47,
...
...
"ok" : 1
}
> db.getCollectionNames();
[ "hit_stats", "hits", "system.indexes", "system.profile", "unicorns" ]
So db.stats
says there are 6 collections where as db.getCollectionNames
lists only 5 collection names. Why this discrepancy?