I am having problems in using Spring to access MongoDB with credentials. While without credentials it works like a charme, using them just fails saying
F
Here is xml version to connect MongoDB 3.0.7 with Spring (parameters are passed from a property file):
Then in Java, you get mongoTemplate like this:
@Autowired
MongoTemplate mongoTemplate;
public String mongoTest() {
DBCollection dc = mongoTemplate.getCollection("yourCollection");
logger.debug("--get collection name=" + dc.getFullName());
}