presto-mongodb/src/main/java/io/prestosql/plugin/mongodb/MongoClientModule.java/MongoClientModule/createMongoSession
class MongoClientModule:    @Singleton
    @Provides
    public static MongoSession createMongoSession(TypeManager typeManager, MongoClientConfig config)
    {
        requireNonNull(config, "config is null");

        MongoClientOptions.Builder options = MongoClientOptions.builder();

        options.connectionsPerHost(config.getConnectionsPerHost())
                .connectTimeout(config.getConnectionTimeout())
                .socketTimeout(config.getSocketTimeout())
                .socketKeepAlive(config.getSocketKeepAlive())
                .sslEnabled(config.getSslEnabled())
                .maxWaitTime(config.getMaxWaitTime())
                .minConnectionsPerHost(config.getMinConnectionsPerHost())
                .readPreference(config.getReadPreference().getReadPreference())
                .writeConcern(config.getWriteConcern().getWriteConcern());

        if (config.getRequiredReplicaSetName() != null) {
            options.requiredReplicaSetName(config.getRequiredReplicaSetName());
        }

        MongoClient client = new MongoClient(config.getSeeds(), config.getCredentials(), options.build());

        return new MongoSession(
                typeManager,
                client,
                config);
    }