com.fourspaces.couchdb
Class ViewResults

java.lang.Object
  extended by com.fourspaces.couchdb.Document
      extended by com.fourspaces.couchdb.ViewResults
All Implemented Interfaces:
Map

public class ViewResults
extends Document

The results of a view request is just a specialized Document object. You can use ViewResults to retrieve information about the results (such as the number of rows returned).

The ViewResults document contains a JSONArray named "rows". This JSON array contains further sub-Documents. These documents include the _id and _rev of the matched Documents as well as any other fields that the View function returns -- it is not the full Document.

In order to retrieve the full document, you must call database.getDocument(id).

Author:
mbreese

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class com.fourspaces.couchdb.Document
database, object
 
Method Summary
 List<Document> getResults()
          Retrieves a list of documents that matched this View.
 View getView()
          The new that created this results list.
 
Methods inherited from class com.fourspaces.couchdb.Document
accumulate, accumulate, accumulate, accumulate, accumulate, accumulateAll, addView, clear, containsKey, containsValue, deleteView, element, element, element, element, element, element, element, elementOpt, entrySet, get, get, getBoolean, getDouble, getId, getInt, getJSONArray, getJSONObject, getJSONObject, getLong, getRev, getRevisions, getString, getView, getViewDocumentId, has, isEmpty, keys, keySet, load, names, opt, optBoolean, optBoolean, optDouble, optDouble, optInt, optInt, optJSONArray, optJSONObject, optLong, optLong, optString, optString, populateRevisions, put, putAll, refresh, remove, remove, setId, setRev, size, toString, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Method Detail

getResults

public List<Document> getResults()
Retrieves a list of documents that matched this View. These documents only contain the data that the View has returned (not the full document).

You can load the remaining information from Document.reload();

Returns:

getView

public View getView()
The new that created this results list.

Returns:


Copyright © 2012. All Rights Reserved.