Class SimpleMongoClientDatabaseFactory

java.lang.Object
org.springframework.data.mongodb.core.MongoDatabaseFactorySupport<com.mongodb.client.MongoClient>
org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory
All Implemented Interfaces:
DisposableBean, CodecRegistryProvider, MongoDatabaseFactory, MongoSessionProvider

public class SimpleMongoClientDatabaseFactory extends MongoDatabaseFactorySupport<com.mongodb.client.MongoClient> implements DisposableBean
Factory to create MongoDatabase instances from a MongoClient instance.
Since:
3.0
Author:
Christoph Strobl
  • Constructor Details

    • SimpleMongoClientDatabaseFactory

      public SimpleMongoClientDatabaseFactory(String connectionString)
      Creates a new SimpleMongoClientDatabaseFactory instance for the given connectionString.
      Parameters:
      connectionString - connection coordinates for a database connection. Must contain a database name and must not be null or empty.
      See Also:
    • SimpleMongoClientDatabaseFactory

      public SimpleMongoClientDatabaseFactory(com.mongodb.ConnectionString connectionString)
      Creates a new SimpleMongoClientDatabaseFactory instance from the given MongoClient.
      Parameters:
      connectionString - connection coordinates for a database connection. Must contain also a database name and not be null.
    • SimpleMongoClientDatabaseFactory

      public SimpleMongoClientDatabaseFactory(com.mongodb.client.MongoClient mongoClient, String databaseName)
      Creates a new SimpleMongoClientDatabaseFactory instance from the given MongoClient.
      Parameters:
      mongoClient - must not be null.
      databaseName - must not be null or empty.
  • Method Details