在Couchbase文档中,以下是配置环境的示例 . 如果有多个桶,会怎么做?
@Configuration
public class Config extends AbstractCouchbaseConfiguration {
@Override
protected List<String> getBootstrapHosts() {
return Collections.singletonList("127.0.0.1");
}
@Override
protected String getBucketName() {
return "beer-sample";
}
@Override
protected String getBucketPassword() {
return "";
}
}
1 回答
对于
2.0.x
branch中的多个存储桶,它当前的工作方式是你必须实例化第二个Bucket
bean和相关的CouchbaseTemplate
(这是最难的部分):在那之后,你'll probably also want some of your repositories to use this second template (and bucket). There'目前也是一个实现(
RepositoryOperationsMapping
),但它可能会改变一点直到即将到来的 2.0.0-RC 所以我不会在那里详细说明 .