스프링 몽고디비 Aggregation1 [MongoDB] 몽고디비 스프링 Aggregation 사용 Spring-Data-MongoDB Aggregation 사용하기 @ Sort 정렬하기 이전의 방식 Aggregation 패턴을 이용해서 Sort를 진행해본다 기존 Aggregation 패턴에서 Operation을 추가하고 Aggregation에 추가를 해주면 된다 sort할 항목과 오름차순, 내림차순을 입력해주면 된다 @ Skip 건너뛰기 건너뛰기도 SkipOpration으로 추가 후 Aggregation에 추가를 해주면 된다 Aggregation.skip(); 에 넣은 데이터 만큼 건너뛰고 출력을 해준다 @ Limit 지정한 수 만큼 가져오기 Limit도 LimitOpration으로 추가 후 Aggregation에 추가를 해주면 된다 Aggregation.limit(); 에 넣은 데이터 만큼 출력을 .. 2016. 7. 4. 이전 1 다음