We are injecting the mongotemplate using the spring config <mongo:mongo-client id="mongoClient" connection-string="${mongodb.connect-string}">