title: Storing word frequency data
body: <p>I am trying to store word frequency data using Mongo. Each word needs to be associated to a user so I can calculate how often an individual uses each word. Currently my words collection looks like this: </p>
  
  <pre><code>{'Hello':3, 'user_id':1}
  </code></pre>
  
  <p>Which obviously only works on a 'One To One' basis and is no good.</p>
  
  <p>I am trying to work out how best to make this a 'One To Many' relationshop between the user and the words. Would I store the user relationship in my words collection like so:</p>
  
  <pre><code>{'word':"Hello", 'users':[{'id':1, 'count':4},{'id':2, 'count':10}]}
  </code></pre>
  
  <p>Or would I attach the word counts to the user collection instead?</p>
  
  <pre><code>{'id':1, 'username':'SomeUser', 'words':[{'Hello':4}]}
  </code></pre>
  
  <p>The obvious disadvantage to the second approach is that the same words will be used across different users, so having a single words collection would help to keeping the data size down.</p>
  
  <p>Can anyone advise me as to what I should do here? Is there a method I have perhaps overlooked in the documentation? </p>