I would really like to use the dot notation to create namespaces for my MongoDB collections' names.
For example:
users
users.admins
users.developers
Is this a bad idea ? Are there any potential problems, drawbacks or limitations when doing this ?
There is nothing wrong with this. In fact, this book recommends the use of dot notation in collections on page 8. It refers to these as subcollections
; however, that term doesn't seem to be in broad use.
It's important to realize that the 3 collections you've listed in your question are 3 distinct collections with no relationship to each other except for their naming. The dot notation does not do anything in terms of MongoDB functionality.
It is useful for organization though, and the collections list nicely when sorted alphabetically. So in summary there are no any drawbacks or potential problems and you gain an advantage as your collection names are better organized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With