spring数据mongodb 1.8.x配置

时间:2016-01-28 03:56:36

标签: java spring mongodb

<mongo:db-factory client-uri="mongodb://${mongo.config.username}:${mongo.config.password}@${mongo.config.replica.set.address}/${mongo.config.database}?replicaSet=${mongo.config.replica.set.name}" />

<bean id="secondaryPreferredReadPreference" class="com.mongodb.TaggableReadPreference.SecondaryPreferredReadPreference"></bean>

<bean id="mongoOperations" class="org.springframework.data.mongodb.core.MongoTemplate">
    <constructor-arg name="mongoDbFactory" ref="mongoDbFactory"/>
    <property name="readPreference" ref="secondaryPreferredReadPreference" />
</bean>

spring-data-mongodb1.8.x和mongodb3.0的replicaSet配置正常。但是,我不知道如何配置连接池大小等的选项....

0 个答案:

没有答案