Copy mongo database post mongo version 4.2 code example
Example: Copy mongo database post mongo version 4.2
mongodump --archive --db=source-db | mongorestore --archive --nsFrom='source-db.*' --nsTo='destination-db.*'
mongodump --archive --db=source-db | mongorestore --archive --nsFrom='source-db.*' --nsTo='destination-db.*'