Created
February 8, 2012 18:41
-
-
Save ingenthr/1772023 to your computer and use it in GitHub Desktop.
Couchbase Server Java example of iterating over document results
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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