MongoDB: db.getMongo() method
db.getMongo
The db.getMongo() method is used to return the Mongo() connection object for the current connection.
Syntax:
db.getMongo()
Returns: The current database connection.
Example: MongoDB: db.getMongo() method
The following statement returns the connection object for the current connection.
db.getMongo();
Output:
> db.getMongo(); connection to 127.0.0.1
Retrieve the restaurants data from here
Previous:
db.getLastErrorObj() method
Next:
db.getName() 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