Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # this will copy the collection 'my_original' to 'my_copy'
- db.my_original.aggregate([{$match: {}}, {$out: "my_copy"}])
- # to move the collection to another db within the same Atlas mongodb cluster
- db.adminCommand({renameCollection: "my_db.my_copy", to: "other_db.other_name"})
Add Comment
Please, Sign In to add comment