/** * @param group Specifies whether the reduce function reduces the result to a set of keys, * or to a single result. Defaults to false (single result). * @return {@link View} */ public View group(Boolean group) { this.group = group; uriBuilder.query("group", this.group); return this; }
public Changes limit(int limit) { uriBuilder.query("limit", limit); return this; }
public Changes includeDocs(boolean includeDocs) { uriBuilder.query("include_docs", includeDocs); return this; }
/** * @param endKeyDocId The end key document id. * @return {@link View} */ public View endKeyDocId(String endKeyDocId) { this.endKeyDocId = endKeyDocId; uriBuilder.query("endkey_docid", this.endKeyDocId); return this; }
/** * @param limit The limit value. * @return {@link View} */ public View limit(Integer limit) { this.limit = limit; uriBuilder.query("limit", this.limit); return this; }
/** * @param stale Accept values: ok | update_after (update_after as of CouchDB 1.1.0) * @return {@link View} */ public View stale(String stale) { this.stale = stale; uriBuilder.query("stale", this.stale); return this; }
/** * @param reduce Indicates whether to use the reduce function of the view, * defaults to true if the reduce function is defined. * @return {@link View} */ public View reduce(Boolean reduce) { this.reduce = reduce; uriBuilder.query("reduce", this.reduce); return this; }
/** * @param includeDocs Indicates whether to include documents * @return {@link View} */ public View includeDocs(Boolean includeDocs) { this.includeDocs = includeDocs; uriBuilder.query("include_docs", this.includeDocs); return this; }
/** * @param updateSeq Indicates whether to include sequence id of the view * @return {@link View} */ public View updateSeq(Boolean updateSeq) { this.updateSeq = updateSeq; uriBuilder.query("update_seq", this.updateSeq); return this; }
/** * @param skip Skips <i>n</i> number of documents. * @return {@link View} */ public View skip(Integer skip) { this.skip = skip; uriBuilder.query("skip", this.skip); return this; }
/** * @param groupLevel The group level * @return {@link View} */ public View groupLevel(Integer groupLevel) { this.groupLevel = groupLevel; uriBuilder.query("group_level", this.groupLevel); return this; }
/** * @param startKeyDocId The start key document id. * @return {@link View} */ public View startKeyDocId(String startKeyDocId) { this.startKeyDocId = startKeyDocId; uriBuilder.query("startkey_docid", this.startKeyDocId); return this; }
/** * Reverses the reading direction, not the sort order. * @param descending The descending value true | false * @return {@link View} */ public View descending(Boolean descending) { this.descending = Boolean.valueOf(gson.toJson(descending)); uriBuilder.query("descending", this.descending); return this; }
/** * @param key The key value, accepts a single value or multiple values for complex keys. * @return {@link View} */ public View key(Object... key) { this.key = getKeyAsJson(key); uriBuilder.query("key", this.key); return this; }
/** * @param endKey The end key value, accepts a single value or multiple values for complex keys. * @return {@link View} */ public View endKey(Object... endKey) { this.endKey = getKeyAsJson(endKey); uriBuilder.query("endkey", this.endKey); return this; }
/** * @param startKey The start key value, accepts a single value or multiple values for complex keys. * @return {@link View} */ public View startKey(Object... startKey) { this.startKey = getKeyAsJson(startKey); uriBuilder.query("startkey", this.startKey); return this; }
/** * Requests Change notifications of feed type normal. * @return {@link ChangesResult} */ public ChangesResult getChanges() { final URI uri = uriBuilder.query("feed", "normal").build(); return dbc.get(uri, ChangesResult.class); }
/** * Gets a design document from the database. * @param id The document id * @param rev The document revision * @return {@link DesignDocument} */ public DesignDocument getFromDb(String id, String rev) { assertNotEmpty(id, "id"); assertNotEmpty(id, "rev"); final URI uri = buildUri(dbc.getDBUri()).path(id).query("rev", rev).build(); return dbc.get(uri, DesignDocument.class); }
/** * Finds a document in the replicator database. * @return {@link ReplicatorDocument} */ public ReplicatorDocument find() { assertNotEmpty(replicatorDoc.getId(), "Doc id"); final URI uri = buildUri(dbURI).path(replicatorDoc.getId()).query("rev", replicatorDoc.getRevision()).build(); return dbc.get(uri, ReplicatorDocument.class); }
/** * Removes a document from the replicator database. * @return {@link Response} */ public Response remove() { assertNotEmpty(replicatorDoc.getId(), "Doc id"); assertNotEmpty(replicatorDoc.getRevision(), "Doc rev"); final URI uri = buildUri(dbURI).path(replicatorDoc.getId()).query("rev", replicatorDoc.getRevision()).build(); return dbc.delete(uri); }