private MappingMongoConverter mappingMongoConverter(final MongoDatabaseFactory mongoDbFactory) {
        val dbRefResolver = new DefaultDbRefResolver(mongoDbFactory);
        val converter = new MappingMongoConverter(dbRefResolver, mongoMappingContext());
        converter.setCustomConversions(customConversions);
        converter.setMapKeyDotReplacement("_#_");
        converter.afterPropertiesSet();
        return converter;
    }
Build mongo template.

@param mongoClient the mongo client
@param mongo       the mongo
@return the cas mongo operations
support/cas-server-support-mongo-core/src/main/java/org/apereo/cas/mongo/MongoDbConnectionFactory.java