On the front end, I have 3 levels of hierarchy.
The top level presents a test summary with statistics such as % pass/fail, various tags, run ids etc.
The second level consists of sections of test suites which can be accessed via the top level run id. This contains the names of the tests, which specific ones passed/failed.
The third level is the actual test itself with a report, pass/fail status etc.
I'm using the MEAN stack for this and was wondering about the trade-offs of using 1,2 or 3 different Mongoose models to store data in MongoDB. I know one of the issues with using embedded documents in an array would be that I would get the whole array back in a query/update instead of a specific element.
Option 1)
Use 3 models, one for each summary, section and test. Then use the same run_id as a value on which I can tie them together.
Option 2)
Use 2 models, summary and section. The section then has an array with embedded docs, each related to a specific test.
Option 3)
Only have test and section models and create the summary if a query needs it.
Not sure if this information is enough, let me know and I can try and add more. Thanks