MongoDB: db.getName() method
db.getName
The db.getName() method is used to return the name of the current database.
Syntax:
db.getName()
Returns: the current database name.
Example: MongoDB: db.getName() method
The following statement will return the name of the current database.
db.getName();
Output:
db.getName(); test
Retrieve the restaurants data from here
Previous:
db.getMongo() method
Next:
db.getPrevError() method
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join