title: Read a file from a mongo shell
body: <p>I have a DB called wordlists and a collection called rockyou.</p>
  
  <p>I have a file called rockyou with the contents:</p>
  
  <pre><code>123456
  12345
  123456789
  password
  iloveyou
  princess
  1234567
  rockyou
  12345678
  abc123
  </code></pre>
  
  <p>What I would like to do is load all of the contents of the file rockyou into the collection rockyou in my wordlists DB.  I have tried searching google but the resources seem slim for mongo.  I could really use some help with this and also maybe some good resources for this new to me DB application.</p>
  
  <p>Thanks!</p>
  
  <p>**EDIT*  Here are the command I have used and some of what I have tried.</p>
  
  <pre><code>use wordlists
  db.createCollection("rockyou")
  db.rockyou.insert(copyFile(~/wordlists/rockyou))
  </code></pre>
  
  <p>I have tried some other methods to insert but now realize there were even further off than this one...</p>