I know that in the MongoDB terminal, I can run show dbs to see the available databases. I want to list the databases in a programmatic way so that I can iterate over them and delete some based upon a regular expression.
I have tried db.runCommand("show dbs") but does not return results to iterate.