这个问题是关于Couchbase lite(没有同步网关)。Android上的Couchbase lite,检索视图
我是Couchbase的新手,我设法使用demo app,但我完全不理解它。 它包含此代码(据我了解,因为我不是以英语为母语)检索意见来填充列表视图与索引:
// This code can be found in ListsActivity.java
// in the setupViewAndQuery() method
com.couchbase.lite.View listsView = mDatabase.getView("list/listsByName");
if (listsView.getMap() == null) {
listsView.setMap(new Mapper() {
@Override
public void map(Map<String, Object> document, Emitter emitter) {
String type = (String) document.get("type");
if ("task-list".equals(type)) {
emitter.emit(document.get("name"), null);
}
}
}, "1.0");
}
listsLiveQuery = listsView.createQuery().toLiveQuery();
谁能给我一份有每个部分有什么手是在做?
在该步骤是在列表视图填充
我可以在代码(第3行)改变 “列表/ listsByName”?会发生什么?
我可以放出多个元素吗?
您是否看过Couchbase培训:https://developer.couchbase.com/documentation/mobile/current/training/index.html?如果您有任何问题,请随时发布到Couchbase论坛。 – Hod
@Hod这正是我从那里得到这段代码的地方,以及我的问题。 – Fahed