Created
March 11, 2020 02:47
-
-
Save gdonega/832661bfcdf59b87a4523f6f8b9b3a80 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.mongodb.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.mongodb.repositories.JogoRepository; | |
@Configuration | |
@EnableMongoRepositories(basePackageClasses = JogoRepository.class) | |
public class MongoConfig extends AbstractMongoClientConfiguration { | |
@Override | |
public MongoClient mongoClient() { | |
return MongoClients.create("mongodb://localhost:27017/"); | |
} | |
@Override | |
protected String getDatabaseName() { | |
return "MongoConexaoTestesDB"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment