1

I actually use couchbase with the java client, but when i query my view, the result is empty. But when i check the number of rows returned, it returns the good number of rows in the database :

ViewResult result = bucket.query(ViewQuery.from("logs", "all_logs"));
System.out.println("Number of rows " + result.totalRows() + " ; success " + result.success()); // Number of rows 12 ; success true
for (ViewRow row : result) {

    System.out.println("hello"); // never here
    System.out.println(row);
}

I try to do :

List<ViewRow> rows = result.allRows();
System.out.println("count : " + rows.size()); // count : 0

My view is in production mode.

Any idea ?

Thanks

FuzzyAmi
  • 7,543
  • 6
  • 45
  • 79
Arthe
  • 53
  • 3
  • I'm little confused by your code, when is `rows` defined? What happens if you change `for (ViewRow row : rows) {` to `for (ViewRow row : result) {` This is the example from the [Couchbase Java SDK](http://docs.couchbase.com/developer/java-2.1/querying-views.html). – Paddy Apr 14 '15 at 10:18
  • Sorry, the rows is from List rows = result.allRows(); I tried the couchbase java sdk example, same problem, count = 12 but when i do " for (ViewRow row : result) {" result is empty. – Arthe Apr 14 '15 at 11:09
  • try creating different view, or use one that comes with brewery sample bucket. – user1697575 Apr 14 '15 at 13:57
  • 1
    @Arthe Can you upload your view code please? – Paddy Apr 14 '15 at 18:00
  • @arthe - any updates here? – FuzzyAmi Aug 04 '15 at 05:59

0 Answers0