Created
March 12, 2020 03:14
-
-
Save gdonega/75fc540dcedeb77b0e396e21d54bf969 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.testes.spring.exemplo.empresas.config; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.data.mongodb.config.AbstractMongoClientConfiguration; | |
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; | |
import com.mongodb.client.MongoClient; | |
import com.mongodb.client.MongoClients; | |
import com.testes.spring.exemplo.empresas.repositories.EmpresaEnvelopeRepository; | |
@Configuration | |
@EnableMongoRepositories(basePackageClasses = EmpresaEnvelopeRepository.class) | |
public class MongoConfig extends AbstractMongoClientConfiguration { | |
@Override | |
public MongoClient mongoClient() { | |
return MongoClients.create("mongodb://localhost:27017/"); | |
} | |
@Override | |
protected String getDatabaseName() { | |
return "MongoLoveEmpresasDB"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment