@Autowired
private MongoTemplate mt;
public String ping()
{
DBObject ping = new BasicDBObject("ping", "1");
try {
CommandResult answer = mt.getDb().command(ping);
return answer.getErrorMessage();
} catch (Exception e) {
return e.getMessage();
}
Thursday 28 November 2019
Check MongoDB connection using MongoTemplate in Spring Boot
Subscribe to:
Posts (Atom)
Code Review
SOLID Principles S – Single Responsibility Principle There should never be more than one reason for a class to change. O – Open-Closed Prin...
-
1. Print the word with odd letters as P M R A O R G O R R A P M #include<stdio.h> #i...
-
Solution: It says that summary column must be an item of a block whose Query All Records or Precompute Summaries are set t...