I want to clone a MongoDB collection and save it on the same server with a different name. So for example right now I have the following collections: demo1.categories, demo1
The fastest option is
db.myoriginal.aggregate([ { $out: "mycopy" } ])