org.springframework.boot.autoconfigure.mongo

Class MongoClientFactory

  • java.lang.Object
    • org.springframework.boot.autoconfigure.mongo.MongoClientFactory


  • public class MongoClientFactory
    extends Object
    A factory for a blocking MongoClient that applies MongoProperties.
    Since:
    2.0.0
    Author:
    Dave Syer, Phillip Webb, Josh Long, Andy Wilkinson, EddĂș MelĂ©ndez, Stephane Nicoll, Nasko Vasilev, Mark Paluch
    • Method Detail

      • createMongoClient

        public com.mongodb.MongoClient createMongoClient(com.mongodb.MongoClientOptions options)
        Creates a MongoClient using the given options. If the environment contains a local.mongo.port property, it is used to configure a client to an embedded MongoDB instance.
        Parameters:
        options - the options
        Returns:
        the Mongo client