title: Exporting data from hdfs to mongodb
body: <p>I am trying to move data from hdfs to mongodb. I am able to achieve this through command line like below.</p>
  
  <pre><code>hadoop fs -text "/user/name.txt" | mongoimport --host 127.0.0.1:27018 -d cds -c hello --type tsv --headerline
  </code></pre>
  
  <p>I need to write  a scala code for this. I have multiple files in the file-system. I have checked mongo-hadoop  connector but I need the opposite of this. Reading files from hdfs and dumping into mongodb in scala.</p>