I'm using Single to retrieve a list from database and since it is only supposed to return a single value I think is the option to go.
I'm having problems retrieving a single value Long from that list that I want to store in a variable.
Single<List<Currency>> currencyListOrigin =
currencyService.getCurrencyByCodeLike(request.getMonedaOrigen());
This is what I want to achieve, but changing this code to get the same result but with Single
Long codOriginCurrency = currencyListOrigin
.stream()
.findFirst()
.map(Currency::getId)
.orElse(null);