I come from SQL relation world, and have a question that involves mongodb schema design.
The reality that i need to represent contains: Users, and monthly reports (with multiple daily reports).
I want to figure out if in mongodb, is better to embedded reports objects into the Users collection, or to have 2 separate collection referenced by id.
Embedded solution:
User:{
     name:
     surname:
     monthlyReports: [{
                month: "January 2014"
                dailyReport: [{
                      day: 1
                      singleReport: [
                         { report1}, {report2}, ...
                      ]
                }, {
                     day: 2
                     singleReport: [ 
                         { report1}, {report2}, ...
                     ]
                }
                ]
           },
           {
            /*
               february 2014
               Day 1
               Day 2 ...
             */
           } ...
     ]
}
Referenced solution:
Users:{
     name:
     surname:
     monthlyReports: [
             id_reportMonth1, id_reportMonth2, ...
     ]
}
MonthlyReport: {
       id:
       month:
       dailyReport: [{
                    day: 1
                    singleReport: [
                            { report1 }, { report2 } ...
                    ]
               },
               {
                } ....
       ]
}
For single user, i need to retrive single daily report, monthly report, and total report.
I think that in embedded solution, querying is more simple, but create large object in a long period.
Another possibility: Create 3 referenced collection: User, monthlyReport, dailyReport.
What is the better way to do it? Someone has suggested?
