New Features and Behaviour Changes in 1.1-dp
The Views functionality has been added to the Couchbase-client library. Views is available starting with Couchbase Server 2.0. For more details on this feature refer to Couchbase Server Manual.
The purpose of a view is take the structured data stored within your Couchbase Server database as JSON documents, extract the fields and information that is needed, and to produce an index of the selected information. The result is a view on the stored data.
The view that is created during this process can be iterated,
selected and queried with the information in the database from
the raw data objects that have been stored using Java objects
such as View, Query,
ViewFuture, ViewResponse
and ViewRow.
The following code fragment illustrates how to use the objects and access the view.
Query query = new Query(); query.setReduce(false); query.setIncludeDocs(true); query.setStale(Stale.FALSE); // Specify the design and document (by default production mode) View view = client.getView("chat", "messages"); if (view == null) { // Take corrective action } ViewResponse result = client.query(view, query); Iterator<ViewRow> itr = result.iterator(); ViewRow row; while (itr.hasNext()) { row = itr.next(); String doc = (String) row.getDocument(); // Do something for each row }
The CouchbaseConnectionFactory which was not
being closed properly has been fixed. The
TapConnectionProvider
patch has been integrated.