I am trying to design my first NoSQL database, and as an example I am trying to grab content from Twitter. I have though some difficulties deciding how to structure the document.
If I am grabbing from several tags (e.g. #Programming #stackoverflow #nosql etc.) each day, how should I structure the documents so they doesn’t grow too large and I still can do analytics based on all the tags?
I thought of creating documents like this:
/{day}/{hashtag}
This would get me the following:
/28052012/Programming
/28052012/StackOverflow
/28052012/NoSql
But how would I then get the latest 5 Tweets from the combined hashtags?
You should use
$oroperator. It can use indexes and will allow you to perform efficient queries.