mongodb / v3.6 / reference / reference-method-db.getName.html

db.getName()

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