title: How do you bulk insert documents in MongoDB from R?
body: <p>I have a dataframe in R and I am trying to bulk insert each row of the dataframe as separate document in MongoDB. The closest I could do is using following script which creates a document and makes the rows of dataframe as its sub document. </p>
  
  <pre><code>x &lt;- toJSON(unname(split(score, 1:nrow(score))))
  bson &lt;- mongo.bson.from.JSON(x)
  mongo.insert(mongo,'abc.abc',x)
  </code></pre>
  
  <p>On the other hand, I want each row as separate document. I also see that above method is very fast but if we loop around the rows, it would highly reduce the speed</p>