Package com.mongodb.hibernate.cfg
Interface MongoConfigurator
@Sealed
public interface MongoConfigurator
The configurator of the MongoDB Extension for Hibernate ORM.
 
     
| Method | Has default | Related configuration property name | Supported value types of the configuration property | Value, unless overridden via MongoConfigurator | 
         
|---|---|---|---|---|
applyToMongoClientSettings(Consumer) | 
             ✓ | "jakarta.persistence.jdbc.url" | Is based on
             the ConnectionString constructed from
             "jakarta.persistence.jdbc.url", if the latter is configured; otherwise a MongoClientSettings
             instance with its defaults. | 
         |
databaseName(String) | 
             ✗ | "jakarta.persistence.jdbc.url" | The MongoDB database name from "jakarta.persistence.jdbc.url",
             if configured;
             otherwise a value must be configured via databaseName(String). | 
         
- See Also:
 
- 
Method Summary
Modifier and TypeMethodDescriptionapplyToMongoClientSettings(Consumer<MongoClientSettings.Builder> configurator) ConfiguresMongoClientSettings.databaseName(String databaseName) Sets the name of a MongoDB database to use. 
- 
Method Details
- 
applyToMongoClientSettings
ConfiguresMongoClientSettings.Note that if you apply a
ConnectionStringwith the database name configured, you still must configure the database name viadatabaseName(String), as there is no way for that to happen automatically.- Parameters:
 configurator- TheConsumerof theMongoClientSettings.Builder.- Returns:
 this.
 - 
databaseName
Sets the name of a MongoDB database to use.- Parameters:
 databaseName- The name of a MongoDB database to use.- Returns:
 this.
 
 -