MongoDB
 sql >> Base de Dados >  >> NoSQL >> MongoDB

A consulta falhou com o código de erro 13 e a mensagem de erro 'não autorizado em [db] para executar o comando { find:


Tente isso para sua configuração xml do Spring
<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/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <mongo:mongo-client credentials="UserAdminNew:[email protected]" />

    <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
        <constructor-arg ref="mongo" />
        <constructor-arg name="databaseName" value="NEWTest" />
    </bean>
</beans>