What are some good ways to store Analytics data using MongoDB for future analysis? I am thinking of doing something like:
> db.analytics.insert( { page: 'product', id: 123, date: new Date('Sept 8, 2010'),
pageviews: 222, timeOnPage: 5432 } )
> db.analytics.find()
{ "_id" : ObjectId("4c8e04b1f14d4366465197b8"), "page" : "product", "id" : 123,
"date" : "Wed Sep 08 2010 00:00:00 GMT-0700 (PDT)", "pageviews" : 222,
"timeOnPage" : 5432 }
which is quite relational. pageviews and timeOnPage can be lumped into
> db.analytics.insert({page: 'product', id: 123, date: new Date('Sept 8, 2010'),
data: { pageviews: 222, timeOnPage: 5432 } })
although if using Mongoid (a Rails Object Relation Mapper), then there is more complication for having an additional model.