Closed thiyaga123 closed 9 years ago
There is no built-in method but you could do this:
var collection = db.collection('scores');
var docsToInsert = < array of documents to insert >;
yield docsToInsert.map(function(doc) {
return collection.insert(doc);
})
Thank you.. But , i dont think , this is optimized of millions of inserts..
Any other way.
I'm afraid not. If the data you wish to insert is readily available in a file you might be better of running a script from the command-line using the mongo
command-line tool.
Just noob question. Can you please give me sample code to "bulk insert" multiple docs.