Command to show the db that I'm currently using in MongoDB?

Found it by guessing :) Simply:

db


The command to get database name in the shell is:

> db.getName()

While just typing db works, you will find that this only works interactively and if you're working on a script this may not give the result you want.