Hi,
I’m using java-client-2.2.6 and I want to query a view as with the following code:
ViewResult result = bucket.query(ViewQuery.from("dev_byType", "byType").stale(Stale.FALSE));
// Iterate through the returned ViewRows
// List<ViewRow> rows = result.allRows();
for (ViewRow row : result) {
System.out.println(row);
}
However, when I want to iterate in viewResult, I’m getting the following execption:
java.lang.IllegalStateException: This Observable can only have one subscription. Use Observable.publish() if you want to multicast.
I’m a newbie, so I couldn’t figure out what’s going on?
Below is map function of my view:
function (doc, meta) {
emit(doc.id, meta.id);
}
I also tried with
function (doc, meta) {
emit(doc.id, null);
}
Yet, did not work.