Not able to sort the documents in descending order on last updated time stamp if the documents having the January and February records. how to get the documents in descending order
Query query= new Query();query.addCriteria(first name).with(Sort.By(Sort.Direction.DESC, lastUpdatedDateTime));
Tried with below query in springboot application
Query query= new Query();query.addCriteria(first name).with(Sort.By(Sort.Direction.DESC, lastUpdatedDateTime));MongoTemplate.find(query, Students list.class, STUDENT_COLLECTION);
Expect the latest records updated from students collection in descending order like first February records then January records