View sub collections as dropdowns or directories and adding a search feature for collections
I think MongoDB Compass is an incredibly powerful software using which one can do easy queries and manipulations to data. I also like the UI - its clutter free and easy to use.
I want to request an additional feature in Compass which isn’t currently there:
Viewing sub collections as dropdowns or directories(Tree structure)
Generally, sub collections are namespaced using a period(.) and they make sense since the data becomes easy to organise and work with.
Say we have nx.ny.na.nb…(n - nodes, x y a and b are integers) type collections
If only a single final collection exists under a particular parent node, then the final collection is directly displayed under the parent node without further nesting.
The root node is always nested.
If a parent node is also a final collection, then the parent node is nested and the final collection is displayed as a child of itself.
If a subcollection ends with a period(.), its treatment will be same as point 3.
For more than one consecutive periods, it is treated as a single collection under its parent. No further nesting occurs.
Collections starting with period would be treated as a single file.
If the parent node only has a single child which is in turn a parent, then both of them can be conglomerated into a single directory. Exception - root node
(Example: Instead of 'n0'->'n1'->n10.coll,n20.coll, it could be 'n0.n1'-> n10.coll, n20.coll[ .coll are just way of representing individual collections])
So if n10.n20 is the only sub collection under n0.n1 and n0.n2 has n66, n55, n66.n95, n55.n85, n66., n66.....54, n66.n95.n54 and n55.n85.n86 as sub-collections the output would be this -
For the dropdown view, I have shown it in the developer forum -
Adding a search bar to search for collections would also be helpful for those who know exactly what they are looking for.
Implementing this would greatly improve readability, and de-clutter the collections for databases.
![](https://secure.gravatar.com/avatar/b927da80ffbf08d4fdf036adab159b10?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)