【发布时间】:2016-01-06 02:19:38
【问题描述】:
我想用 spring 将 orderby 添加到 mongodb 中的以下存储库方法中。我尝试了各种方法,但没有奏效
public interface StageRepository extends MongoRepository<Stage, String> {
@Query("{$and: [ { 'categoryId': { $eq: ?0 } }, { 'isDeleted': { $eq: ?1 } } ]}")
public List<Stage> findByCategoryIdAndIsNotDeleted(String categoryId, Boolean deleted);
}
我想在查询中添加 orderby 'order'。
不知道怎么做。
【问题讨论】:
标签: spring mongodb spring-mongo