I have a Map<String, long>. I am using “exists” to find if the key is in Couchbase. It returns a Observable. I want to filter out the keys that are in Couchbase and return only keys that were in Couchbase.
How do I return the the keys ?
.flatMap(new Func1<Entry<String,Long>, Observable<Boolean>>() {
@Override
public Observable<Boolean> call(Entry<String, Long> entry) {
return bucket
.async()
.exists(entry.getKey());
}
})
.filter(new Func1<Boolean, Boolean>() {
@Override
public Boolean call(Boolean t) {
return t;
}
})