db.myoriginal.aggregate([ { $out: "myCopy" } ])
db.runCommand({
aggregate: "myOriginal",
pipeline: [{ $match: {} }, { $out: "myCopy" }]
});
Fastest way to duplicate mongodb collection
db.myoriginal.aggregate([ { $out: "myCopy" } ])
db.runCommand({
aggregate: "myOriginal",
pipeline: [{ $match: {} }, { $out: "myCopy" }]
});