Thank you very much @steevej . You dont know how much i appreciated your answer. Being not that experienced with mongodb, for quite sometime im trying to find some good-enough solution that would cover standard operation that user can do with regular spreadsheet or table of data, including ability to support:
- adding/removing/renaming columns
- sorting per columns
- reordering of columns
- support large tables (like 50 columns, 10 thousands rows)
I have tried to seek some answers and shared my thoughts in this forum on following link, regarding how this could be designed in mongodb: Database design for tabular data (user defined columns with potentially lof of rows of data to maintain) - #3 by Satyam
Just to answer to your questions:
Are you going to access a table without its table_rows? => rarely, if ever
Are you going to access a table_row without its table? => rarely, if ever
Im totally aware that data that should be queried together should be part of same collection, and that was my first attempt as explained in above referenced question. My concern about that approach is that if everything is in same collection, more or less i will hit unbound array problem with mongodb, correct?
The reasoning behind, solution i proposed here where dynamic object id in card_rows collection is actually columnId, is that i need ability to sort, filter and do other aggregate operation on card rows.
Now looking at your proposed solution it looks much more better.
In your opinion with your proposed solution, would these operations like grouping, sorting, etc, work with elements of array and does this come with some drawbacks in your opinion?
Again, really really thank you for your time and for your answer.