Return Types

Last updated 4 months ago

You can ask the query() method to return an array default, a Java ViewReponse object, or a Java iterator. By default we use the native CFML array type which uses transformations, automatic deserializations and inflations.

// Get an iterator of Java objects
iterator = couchbase.query(
designDocumentName = 'beer',
viewName = 'brewery_beers',
returnType = 'Iterator'
);
‚Äč
while( iterator.hasNex() ) {
writeOutput( iterator.getNext().getKey() );
}