What’s the fastest way to copy a collection within the same database?

> db.myoriginal.aggregate([{$out: "mycopy"}])

It is a lot faster than doing many inserts in a forEach loop.

Leave a Comment