I have the following working configurations in my Spring application:
<mongo:mongo id="myRs" replica-set="myhost:27017">
<mongo:options max-wait-time="1500"
connect-timeout="30000" />
</mongo:mongo>
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<property name="writeResultChecking" value="EXCEPTION"/>
<property name="writeConcern" value="FSYNC_SAFE"/>
<constructor-arg ref="myRs"/>
<constructor-arg name="databaseName" value="mydb"/>
</bean>
Now all I want to do is to set up username/password for accessing the mongo database without changing my code (i.e. only by updating the Spring app context xml file). Is that possible? If so, how?
Thanks.