I'm playing with a small web application to store tasks and time spent on a daily basis, and report on it in weekly and monthly reports.
For my back-end I wanted to work with MongoDb but can't immediately find what the best way would be to store the time spent on a task. I have no interest in storing the actual timeframe (start and stop date), just the time spent in hours:minutes.
Since I will be making weekly and monthly reports, I need to be able to calculate the sum on a weekly, monthly basis.
What would be the best way to store the time spent?
I'm leaning towards just storing the amount of minutes in a 32-bit integer and convert it to hours:minutes on the client. (Or better yet, convert it already in a Mongodb Aggregation Query, if that's possible?)
My Task document would look like this then
{
"task_id": {
"$oid": "5311a0a4e4b0386017fce592"
},
"timeEntry_date": "ISODate('2014-03-02')",
"timeSpent_minutes": 30
}
Is this the way to go in MongoDb?
Sorry if I'm stating the obvious here, just starting to learn about MongoDB...