Skip to content

Instantly share code, notes, and snippets.

@ingenthr
Created February 8, 2012 18:41
Show Gist options
  • Select an option

  • Save ingenthr/1772023 to your computer and use it in GitHub Desktop.

Select an option

Save ingenthr/1772023 to your computer and use it in GitHub Desktop.
Couchbase Server Java example of iterating over document results
View view = cbc.getView("$dev_testing", "atest");
Query myQuery = new Query();
myQuery.setRange("M", "N");
ViewResponse queryResults = cbc.query(view, myQuery);
Iterator<ViewRow> walkthrough = queryResults.iterator();
System.err.println("Found " + queryResults.size() + " docs.");
while (walkthrough.hasNext()) {
ViewRow next = walkthrough.next();
System.err.println(next.getDocument());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment