Imagine I have a document like this:
post = {title: "a", comments: [{hour: "08:00", "text": "abc"}, {hour: "09:00", "text": "def"}]}
Now I might have about 1000 posts and each have 100 comments, that means we have around 100000 comments,
- but how I might find which is the most common hour that a comment is made?
- It's even possible to keep up to 100, or 1000 comments for example?
- Get all the users comments? I might make an array on the user document with comments = [...]?
- I see they have not a _key property, but I would like to use one, is possible without implementing my own key gen system?
- It's possible to have a collection with comments and keep them there too?
Another example would be:
article = {code: "X900123", quantity: 24, movementsHistory: [{date:20120101, quantity: 3}, {date:20120102, quantity: 5}]}
how this could be made if I would want all the movements for all the articles made on 20120101 that were bigger than 25% of the current stock? - In mysql I would have a table for articles and movements, then each movement is linked to the article. Therefore I could make a join on articles and movements and get the results. (about all articles, not one by one)
thanks for help (: