Case study: Structured data

In this case study the data is reduced to two collections: 


The papers are listed in the subject document.   See how this works here. Click 'Edit' to see how papers are added and removed.  The schema for the subjects collection is here.  


The data in this case includes a list of subjects. Each of the subjects has a list of exam papers and results. So this is quite a bit more complex  See this in action here to log in to this demonstration and see a student document.   Click on 'more...' to see the subject, papers and scores. Click edit to see how this information is edited. The structured fields are in bold type. So the address is split into separate fields. There are a couple of subjects, and under this there are some papers and results. You can add or remove subjects and results without leaving the page.  

The schema for the student collection is here.  As you can imagine, it is more complex than previous examples. In constructing the selection lists for the papers, the user has to select the subject first. This changes the select options for the papers. This means that the page has to query the database while you still have the page open. In fact when you click on the select field for the paper, the systems queries the database  and you may see 'please wait'  while this happens. This procedure needed some custom Javascript code to be written (around 20 lines of code).   


Next: Variable data