I am trying to copy a million document in a collection to another colletion.
> db.source_collection.find().forEach(function(doc) { db.dest_collection.insertOne(doc)});
This works fine. but I wonder it might cause any trouble to operating Database if I loop a million documents.
Can I give a sleep while looping in mongh shell? Is there any better solution for this?
Please advise me.