suchen

Heim  >  Fragen und Antworten  >  Hauptteil

Spring-data-MongoDB排序

使用Spring-data-MongoDB框架,查询时排序,在网上看到有些写new Query().sort.on这种写法的,但我使用的1.3.1版本并没有这个方法,不知道该如何排序。还请有知道的大牛指点一二。

ringa_leeringa_lee2885 Tage vor658

Antworte allen(1)Ich werde antworten

  • 大家讲道理

    大家讲道理2017-04-22 09:01:30

        Direction direction=true?Direction.ASC:Direction.DESC;
        query.with(new Sort(direction,key));
    

    Antwort
    0
  • StornierenAntwort