Docs HomeMongoDB Manual

db.getName()

db.getName()
Returns:返回:the current database name.当前数据库名称。