Result Types
Reactive Mongo DSLのFlux/MonoターミナルとPageResult、PageStream、ResultTupleの結果タイプを整理します。
ターミナルの基本返却形式
findAll / Search findAll / Vector findAll
Flux<E>
find / Search find / Vector find
Mono<E>
count
Mono<Long>
exists / existsQuery
Mono<Boolean>
distinct
Flux<R>; 필요할 때 호출 측에서 collectList()
PageResult<T>
getData()
현재 page의 List<T>
getTotalCount()
全体のマッチングカウント
map / mapNotNull / filter / filterNotNull
totalCountを維持しながら現在のページデータを変換
size / isEmpty
現在のページデータに基づくヘルパー
totalPages / hasNext
totalCountとページサイズを利用したページ計算ヘルパー
PageStream<T>
data()
현재 page data Flux<T>
totalCount()
전체 count Mono<Long>
map / mapNotNull / filter / filterNotNull / onEach
totalCount publisherを維持したreactiveデータ変換
size() / isEmpty() / totalPages() / hasNext()
Monoベースのreactiveページヘルパー
collectToPageResult()
data Flux를 List로 모아 Mono<PageResult<T>>로 변환
ResultTuple<L, R>
getLeftName() / getLeft()
左側のクエリビルダー名と結果
getRightName() / getRight()
右側のクエリビルダー名とlookup/group結果
getTotalCount()
該当タプルに選択的に接続されたtotalCount
getRightIfListFirst()
rightがListの場合、最初の要素を返し、nullまたは空のListの場合はnullを返します