Docs Home → MongoDB Manual

db.getName()

db.getName()
Returns:the current database name.