0

This question already has an answer here:

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.

marked as duplicate by Michael Green, mustaccio, McNets, John aka hot2use, LowlyDBA Dec 6 '18 at 16:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • What is MongoDB version(x,y,z)? – Md Haidar Ali Khan Dec 4 '18 at 10:26
  • MongoDB Version 4 – Varsh Dec 4 '18 at 11:32
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.