Я пытаюсь использовать уменьшение карты на CouchBase Lite. У меня есть документы, и они направляются. Все документы, которые я хочу, приходят на Couchbase Lite. Но когда я пытаюсь запустить на них map-reduce, я получаю следующую ошибку
com.couchbase.lite.CouchbaseLiteException: Error when calling map block of view 'calendar', Status: 593 (HTTP 500 Application callback block failed)
Ниже моя функция уменьшения карты
private View createView(Database database){
View calendarView = database.getView("calendar");
calendarView.setMap(new Mapper() {
@Override
public void map(Map<String, Object> document, Emitter emitter) {
emitter.emit((long) document.get("date"),(long) document.get("cost"));
}
},"2");
return calendarView;
}
и Ниже приведена часть main, где я вызываю представление и запрашиваю его.
View calendarView = createView(database);
Query query = database.getView("calendar").createQuery();
query.setStartKey(1472467249448l);
query.setEndKey(1472553649449l);
QueryEnumerator result = null;
try {
result = query.run();
} catch (CouchbaseLiteException e) {
e.printStackTrace();
}
for (Iterator<QueryRow> it = result; it.hasNext(); ) {
QueryRow row = it.next();
Log.d(TAG, row.getValue().toString());
}