Package com.leumanuel.woozydata.config
Class MongoConfig
java.lang.Object
com.leumanuel.woozydata.config.MongoConfig
Configuration class for MongoDB connection management.
Handles the creation and management of MongoDB client connections.
- Version:
- 1.0
- Author:
- Leu A. Manuel
-
Constructor Summary
ConstructorsConstructorDescriptionMongoConfig(String connectionString, String dbName) Creates a new MongoDB configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the MongoDB client connection.com.mongodb.client.MongoDatabaseGets the configured MongoDB database instance.
-
Constructor Details
-
MongoConfig
Creates a new MongoDB configuration.- Parameters:
connectionString- MongoDB connection stringdbName- Database name to connect to
-
-
Method Details
-
getDatabase
public com.mongodb.client.MongoDatabase getDatabase()Gets the configured MongoDB database instance.- Returns:
- MongoDatabase instance
-
close
public void close()Closes the MongoDB client connection. Should be called when the connection is no longer needed.
-