Is there a simple way to do this?
If RAM is not an issue using insertMany is way faster than forEach loop.
insertMany
forEach
var db1 = connect(':/') var db2 = connect(':/') var _list = db1.getCollection('collection_to_copy_from').find({}) db2.collection_to_copy_to.insertMany(_list.toArray())