add customize db config to README.md (#402)
This commit is contained in:
Родитель
96514d8fe3
Коммит
b0f028b3fd
11
README.md
11
README.md
|
@ -62,7 +62,7 @@ This repository supports both Spring Data 1.x and 2.x. Please see [this document
|
|||
return new ObjectMapper(); // Do configuration to the ObjectMapper if required
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Add the dependency
|
||||
|
@ -99,6 +99,15 @@ public class AppConfiguration extends AbstractDocumentDbConfiguration {
|
|||
}
|
||||
}
|
||||
```
|
||||
Or if you want to customize your config:
|
||||
```java
|
||||
public DocumentDBConfig getConfig() {
|
||||
DocumentDBConfig dbConfig = DocumentDBConfig.builder(uri, key, dbName).build();
|
||||
dbConfig.getConnectionPolicy().setConnectionMode(ConnectionMode.DirectHttps);
|
||||
dbConfig.getConnectionPolicy().setMaxPoolSize(1000);
|
||||
return dbConfig;
|
||||
}
|
||||
```
|
||||
By default, `@EnableDocumentDbRepositories` will scan the current package for any interfaces that extend one of Spring Data's repository interfaces. Using it to annotate your Configuration class to scan a different root package by type if your project layout has multiple projects and it's not finding your repositories.
|
||||
```java
|
||||
@Configuration
|
||||
|
|
Загрузка…
Ссылка в новой задаче