I am trying to retrieve bulk data from Couchbase ( vers: 4.5.1). Data are of type Set DataStructure[Basically Array]. I have been able to retrieve single entries in Json Array Document of type Set and also able to retrieve normal Json Document in async using rx.Observable. I am trying to do the fusion where i can retrieve data of Set using rx.Observable.Is it possible?No N1QL query as data is not indexed.
Thanks in advance.
Hi Tanmoy,
I’m not aware of any built-in mechanism, but it’s possible to create an Observable from any Iterable using Observable.from(Iterable)
.
Here’s what that might look like:
Bucket bucket = cluster.openBucket("default");
CouchbaseArraySet<String> words = new CouchbaseArraySet<>("words::en-US", bucket);
words.add("hello");
words.add("world");
Observable<String> observable = Observable.from(set);
observable.subscribe(System.out::println);
Output:
hello
world
1 Like