Convert Mono to list

I have this Mono list:

Mono<List<MasterPair>> list;

Into MasterPair I have a Long id;

How I can convert the list like this:

Mono<List<Long>> list;

>Solution :

You can unroll it, map, then reroll it into a List.

list
.flatMapIterable(v -> v)
.map(v -> v.id)
.collectList()

Leave a Reply