<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配置正常。但是,我不知道如何配置连接池大小等的选项....