title: mongodb import xml into mongodb
body: <p>I have problem with importing big xml file (1.3 gb) into mongodb in order to search for most frequent words in map &amp; reduce manner. </p>
  
  <p><a href="http://dumps.wikimedia.org/plwiki/20141228/plwiki-20141228-pages-articles-multistream.xml.bz2" rel="nofollow">http://dumps.wikimedia.org/plwiki/20141228/plwiki-20141228-pages-articles-multistream.xml.bz2</a></p>
  
  <p>Here I enclose xml cut (first 10 000 lines) out from this big file:</p>
  
  <pre><code>http://www.filedropper.com/text2
  </code></pre>
  
  <p>I know that I can't import xml directly into mongodb. I used some tools do so. I used some python scripts and all has failed.</p>
  
  <p>Which tool or script should I use? What should be a key &amp; value?
  I think the best solution to find most frequent world would be this.</p>
  
  <pre><code>(_id : id, value: word )
  </code></pre>
  
  <p>then I would sum all the elements like in docs example:</p>
  
  <p><a href="http://docs.mongodb.org/manual/core/map-reduce/" rel="nofollow">http://docs.mongodb.org/manual/core/map-reduce/</a></p>
  
  <p>Any clues would be greatly appreciated, but how to import this file into mongodb to have collections like that?</p>
  
  <pre><code>(_id : id, value: word )
  </code></pre>
  
  <p>If you have any idea please share.</p>
  
  <p>Edited
  After research, I would use python or js to complete this task.</p>
  
  <p>I would extract only words in <code>&lt;text&gt;&lt;/text&gt;</code> section which is under <code>/&lt;page&gt;&lt;revision&gt;</code>, exlude &amp;lt, &amp;gt etc., and then separate words and upload them to mongodb with pymongo or js.</p>
  
  <p>So there are several pages with revision and text.</p>
  
  <p>Edited</p>