0

I want to take a collections data backup on a different host, with renaming the Collections.

I am very new to MongoDB. Please help me with this task.

2
  • What is MongoDB version(x,y,z)? Commented Dec 4, 2018 at 10:26
  • MongoDB Version 4
    – Varsh
    Commented Dec 4, 2018 at 11:32

1 Answer 1

0

You can with this command rename your collection:
db.rrecord.renameCollection("record")

Then backup with this:
mongodump --host mongodb1.example.net --port 3017 --username user --password "pass" --out /opt/backup/file

Tip: You can specify different host for save your backup file.

Not the answer you're looking for? Browse other questions tagged or ask your own question.