0

I am running into a situation where I want to only dump and restore mongo databases that contains the prefix "user" i.e user_5956ed801cc421a7a0c3132e. I am working on an App where every user gets his/her own database. Is this possible to achieve with mongodump and mongorestore.

Community
  • 1
  • 1
Yasin Yaqoobi
  • 1,888
  • 3
  • 27
  • 38
  • As at MongoDB 3.4 there is no built-in option for exporting databases by prefix, but you could write a shell script or similar to find matching database names and call `mongodump`. Are you aiming to create a separate backup of each user's database or combine into a single "users" backup? – Stennie Jul 11 '17 at 02:01
  • Hmm, I am pretty terrible with shell stuff. The goal is to create a separate backup. – Yasin Yaqoobi Jul 12 '17 at 15:50

0 Answers0