Spring does not return a status configuration when inserting a database: Write-concern get exception
<beans xmlns= "Http://www.springframework.org/schema/beans" xmlns:xsi= "http://www.w3.org/2001/ Xmlschema-instance "xmlns:mongo=" Http://www.springframework.org/schema/data/mongo "xsi:schemalocation="/HTTP/ Www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd HTTP://WWW.S Pringframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo.xsd ">< !--Configure Spring-data Connection MONGO Mongotemplate-<!--first list the level parameters of the Writeconcern that throw the exception: Writeconcern.none: no exception thrown Writeconcern.normal: Throw only network error exception, no server error exception Writeconcern.safe: Throw network error exception, server error exception, and wait for the server to complete the write operation. Writeconcern.majority: Throws a network error exception, server error exception, and waits for a master server to complete the write operation. Writeconcern.fsync_safe: Throws network error exception, server error exception, write operation waits for server to flush data to disk. Writeconcern.journal_safe: Throws a network error exception, a server error exception, and a write operation waits for the server to submit a log file to disk. Writeconcern.replicas_safe: Throws a network error exception, server error exception, wait for at least 2 servers to complete the write operation. --><mongo:mongo-client replica-set= "${im.mongodb.replica.set}" ><moNgo:client-options write-concern= "NORMAL"/></mongo:mongo-client><!--Mongo template class instance--><bean id= " Mongotemplate "class=" org.springframework.data.mongodb.core.MongoTemplate "><constructor-arg ref=" MONGO "/ ><constructor-arg name= "DatabaseName" value= "${im.mongodb.name}"/></bean>
Explanation of Write-concern in MongoDB in spirng