I would like to get the list of the database manage by on server through a single shell command, on UNIX. The objective is to be able to do a full export of all dbs for validation purposes.
Right now, I can see only two ways to do this.
- Start mongo, type show dbs, to a manual copy of the list and exit. I do not like this way as this requires several manual operations.
- Scan the files.*.0 in the db directory.
This works but is dependent on the format of the database.Is there any better way to list all the DBs managed by a server through a single command? I am using MongoDB 3.0.4 on Scientific Linux.