@Override
    public RegisteredService save(final RegisteredService svc) {
        svc.assignIdIfNecessary();
        invokeServiceRegistryListenerPreSave(svc);
        this.mongoTemplate.save(svc, this.collectionName);
        LOGGER.debug("Saved registered service: [{}]", svc);
        return this.findServiceById(svc.getId());
    }
<p>Implementation of {@code ServiceRegistry} that uses a MongoDb repository as the backend
persistence mechanism. The repository is configured by the Spring application context. </p>
<p>The class will automatically create a default collection to use with services. The name
of the collection may be specified.
It also presents the ability to drop an existing collection and start afresh.

@author Misagh Moayyed
@since 4.1
support/cas-server-support-mongo-service-registry/src/main/java/org/apereo/cas/services/MongoDbServiceRegistry.java