StevenE
unread,Feb 10, 2012, 9:04:01 AM2/10/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Hi
I was wondering if Map/Reduce could be used for replicate the RRD
derive feature. i.e:
I have a simple database structure for tracking a users time on a
website. The session_time entry is accumulative. i.e The first
session_time entry when you search and sort by session_id and
session_time with always be 0 last entry will always be the total
session time
This is how the data is saved:
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 0,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 31,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 61,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 93,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 123,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 154,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 184,
created_at: DATETIME }
It would be very helpful to show the data like this when searching
according to a date range and user_id
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 0,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 31,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 30,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 32,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 30,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 31,
created_at: DATETIME }
{ _id: "xxx", user_id: "xxx", session_id: "1234", session_time: 30,
created_at: DATETIME }
Thanks and jolly salutes