I just discovered a bizarre behavior exhibited by MongoDB.
Apparently, any collection name with the string “system.” anywhere in it will just not function correctly.
To make matters worse, it won’t even tell you anything is wrong!
It’s really more a matter of curiosity, but does anybody have any idea why this would happen? Is it documented somewhere?
My assumption is that it uses “”system.*” collections to store things internally (like indexes) and doesn’t want you messing with them, but this doesn’t seem like the correct behavior to me.
You are correct “system.*” is a reserved collection namespace used by MongoDB in each DB.
It is used to store indexes and users, etc.
SQL Server has many such tables too, and I don’t believe they warn you not to use them either 🙂
But you could always put in a request for such functionality: http://jira.mongodb.org/
You can see them by running …
> show collectionsand you’ll see something like …
system.indexessystem.usersSo, you can see your indexes for example:
> db.system.indexes.find()From the MongoDB docs:
http://docs.mongodb.org/manual/reference/system-collections/