I am currently having this code to get Couchbase JsonDocument using the below code. I am trying to Migrate to Couchbase SDK3.2 and in 3.2 SDK Obseravable and JsonDocument is not being used. How can i use Flux to achieve the below code ?
List<JsonDocument> foundDocs = Observable.from(campaignIdList)
.flatMap(new Func1<String, Observable<JsonDocument>>() {
@Override
public Observable<JsonDocument> call(String id) {
return bucket.async().get(id);
}
})
.toList()
.toBlocking()
.single();
The most simplistic bulk fetch (without error handling or anything) looks like this:
Note that this is a blocking call and should not be used within a reactive pipeline.
You may find more samples here https://docs.couchbase.com/java-sdk/3.2/howtos/concurrent-async-apis.html