I save tweets to mongo DB:
twit.stream(\'statuses/filter\', {\'track\': [\'animal\']}, function(stream) {
stream.on(\'data\', function(data) {
c
I could tell you how you can group using aggregation framework directly on mongo console
db.tweets.aggregate(
{ "$project": {
"y":{"$year":"$created_at"},
"m":{"$month":"$created_at"},
"d":{"$dayOfMonth":"$created_at"},
"h":{"$hour":"$created_at"},
"tweet":1 }
},
{ "$group":{
"_id": { "year":"$y","month":"$m","day":"$d","hour":"$h"},
"total":{ "$sum": "$tweet"}
}
})
For more options you can look here: http://docs.mongodb.org/manual/reference/operator/aggregation-date/
You will also need to find appropriate way of of using aggregation framework from whichever programming language you are using.