A mongosh helper command (not JavaScript): prints each database name and size. Databases appear only after they hold data. Related: use mydb to switch into one.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.