title: Updating Large Json Files to Mongo
body: <p>I'm having trouble updating large json files to mongo. I perform a:</p>
  <pre><code>with open('one.json') as f:   data = json.load(f)
  </code></pre>
  <p>And then iterate through the length of data document by document. When I try running this on an EC2 instance, it gets killed since it run's out of memory. I'm trying to see if I can iterate through this file one document at a time. Its the results of a scrapy scraping job. Here's a sample output of a json file with only 4 entries to see how the json is laid out:<br />
  [<br />
  {&quot;ID&quot; : &quot;1&quot;},<br />
  {&quot;ID&quot; : &quot;2&quot;},<br />
  {&quot;ID&quot; : &quot;3&quot;},<br />
  {&quot;ID&quot; : &quot;4&quot;},<br />
  ]<br />
  How can I iterate through this one document at a time. such as only ID=1 is processed, then read next etc.</p>