public void map(Map<String, Object> doc, Emitter emitter) {
if (doc.get("type").equals("forms")) {
List<Object> keys = new ArrayList<Object>();
keys.add(doc.get("parent_uuid"));
keys.add(doc.get("uuid"));
emitter.emit(keys, null);
}
}
View view = database.getView("forms");
QueryOptions options = new QueryOptions();
List<Object> keys = new ArrayList<Object>();
keys.add(new Object[]{parent_uuid, uuid});
options.setKeys(keys);
resources = view.queryWithOptions(opts);
List<Object> keys = new ArrayList<Object>();
keys.add(new Object[]{parent_uuid, new HashMap<String, Object>()});
On Jul 16, 2015, at 12:05 PM, macs.d...@gmail.com wrote:However, how would i query all documents that belong to a certain parent. Would that be possible with the above map function? Or would i need a second map function?
On Jul 16, 2015, at 10:30 PM, atom992 <yangzi...@gmail.com> wrote:startkey=["key1","type1"]endkey=["key1","type1",{}]
I try to query the data using the startkey and endkey by RCBL EST API but got error:
—Jens
On Jul 17, 2015, at 4:51 AM, atom992 <yangzi...@gmail.com> wrote:GET /cbldb/_design/poc/_view/getListByKey?stale=ok&connection_timeout=60000&startkey=%5B%22KEY:4f9a9c7f-969e-44a4-89b0-19411c8e6b46%22%2C%22TYPE1%22%%5D%22&endkey=%5B%22KEY:4f9a9c7f-969e-44a4-89b0-19411c8e6b46%22%2C%22TYPE1%22%2C%7B%7D5D HTTP/1.1