Actually i need to find select MAX(lastUpdatedTime) from TABLE
i am doing:
TableRepositoryImpl.java
*maxTime(){
Query query= new Query().limit(1).with(Sort.by(Sort.Direction.DESC, "lastUpdatedTime"))
return mongoTemplate.findOne(query, TABLE.class)
}*
but this sort method take extra time, can anybody knows how to implement by using MAX function as we do in sql. or any other optimize way, i just need to find the lates updated timeStamp in my mongoDB