-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add search pagination operation #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughProjectStageDsl에 searchSequenceToken(alias: String = "paginationToken") 메서드가 추가되고, SearchStageDsl에 nullable 속성 searchAfter와 searchBefore가 추가되었습니다. 관련 단위 테스트들이 각각 추가되어 새 필드와 메타데이터의 JSON 렌더링을 검증합니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as 개발자 코드
participant DSL as SearchStageDsl / ProjectStageDsl
participant Mongo as Atlas Search
Dev->>DSL: searchAfter = "token" / searchBefore = "token"
note right of DSL #DDEBF7: SearchStageDsl가 내부 문서에\n"searchAfter"/"searchBefore" 키 설정
Dev->>DSL: project.searchSequenceToken("alias")
note right of DSL #F6F8E6: ProjectStageDsl가 메타\n"searchSequenceToken"을 등록
DSL->>Mongo: Aggregation pipeline 포함된 search stage\n(contains searchAfter/searchBefore, project meta)
Mongo-->>DSL: Search 결과(페이징 가능 토큰 포함)
코드 리뷰 예상 소요 시간🎯 2 (간단함) | ⏱️ ~12분 시 (詩)
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
64dc49f to
d031b8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
core/src/main/kotlin/com/github/inflab/spring/data/mongodb/core/aggregation/search/SearchStageDsl.kt (1)
73-82: 구현이 올바르며, 선택적 개선 사항을 고려해보세요.
searchBefore속성이 기존 패턴을 잘 따르고 있습니다.MongoDB Atlas Search에서
searchAfter와searchBefore는 일반적으로 상호 배타적입니다(각각 순방향/역방향 페이지네이션에 사용). 두 속성을 동시에 설정할 경우 의도하지 않은 동작이 발생할 수 있습니다. 필요하다면 setter에서 상호 배타성 검증을 추가하는 것을 고려해볼 수 있지만, MongoDB가 이를 자체적으로 처리할 수 있다면 현재 구현도 충분합니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
core/src/main/kotlin/com/github/inflab/spring/data/mongodb/core/aggregation/ProjectStageDsl.kt(1 hunks)core/src/main/kotlin/com/github/inflab/spring/data/mongodb/core/aggregation/search/SearchStageDsl.kt(1 hunks)core/src/test/kotlin/com/github/inflab/spring/data/mongodb/core/aggregation/ProjectStageDslTest.kt(1 hunks)core/src/test/kotlin/com/github/inflab/spring/data/mongodb/core/aggregation/search/SearchStageDslTest.kt(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- core/src/main/kotlin/com/github/inflab/spring/data/mongodb/core/aggregation/ProjectStageDsl.kt
🔇 Additional comments (4)
core/src/test/kotlin/com/github/inflab/spring/data/mongodb/core/aggregation/search/SearchStageDslTest.kt (2)
261-282: 테스트 구현이 올바릅니다!
searchAfter옵션 테스트가 기존 테스트 패턴을 잘 따르고 있으며, JSON 출력 검증이 정확합니다.
284-305: 테스트 구현이 올바릅니다!
searchBefore옵션 테스트가 기존 테스트 패턴을 잘 따르고 있으며, JSON 출력 검증이 정확합니다.core/src/test/kotlin/com/github/inflab/spring/data/mongodb/core/aggregation/ProjectStageDslTest.kt (1)
248-271: 테스트 구현이 올바릅니다!
searchSequenceToken메타 프로젝션 테스트가 기존의 다른 메타 필드 테스트(searchScore,searchScoreDetails등)와 동일한 패턴을 따르고 있으며, Atlas Search 페이지네이션 토큰 처리를 위한 올바른 JSON 구조를 검증하고 있습니다.core/src/main/kotlin/com/github/inflab/spring/data/mongodb/core/aggregation/search/SearchStageDsl.kt (1)
62-71: 구현이 올바릅니다!
searchAfter속성이 기존 속성들(index,returnStoredSource등)과 동일한 패턴을 따르고 있으며, KDoc에 MongoDB 공식 문서 링크가 포함되어 있어 좋습니다.
resolve #110
Summary by CodeRabbit
새로운 기능
테스트