I'm fairly new on mongodb, and while I'm trying to make ordered mongodb query. But spring data mongodb's sort method is deprecated. So I used org.springframework.data.domain.Sort:
org.springframework.data.domain.Sort
Query query = new Query(); query.with(new Sort(Sort.Direction.ASC,"pdate")); return mongoTemplate.find(query, Product.class);
I used this code block. But its not sorting the data. So can you prefer to use any useful method for this practice?
You can define your sort in this manner to ignore case:
new Sort(new Order(Direction.ASC, FIELD_NAME).ignoreCase()
1.4m articles
1.4m replys
5 comments
57.0k users