public static void createCollection(final MongoOperations mongoTemplate, final String collectionName, final boolean dropCollection) {
        if (dropCollection) {
            LOGGER.trace("Dropping database collection: [{}]", collectionName);
            mongoTemplate.dropCollection(collectionName);
        }

        if (!mongoTemplate.collectionExists(collectionName)) {
            LOGGER.trace("Creating database collection: [{}]", collectionName);
            mongoTemplate.createCollection(collectionName);
        }
    }
Create collection.

@param mongoTemplate  the mongo template
@param collectionName the collection name
@param dropCollection the drop collection
support/cas-server-support-mongo-core/src/main/java/org/apereo/cas/mongo/MongoDbConnectionFactory.java