0

我试图理解 documentID 和 sourceDocumentID 之间的区别,但就是做不到。我应该访问行的 documentID 还是 sourceDocumentID?我正在尝试在我的 iOS 应用程序中实现分页(即类似于蒲团的东西)所以,我需要最后一个 documentID 来生成下一组行。有人可以启发我吗?

4

2 回答 2

0

You can implements pagination by using two levels of Reference Documents (http://docs.couchbase.com/couchbase-devguide-2.1/#using-reference-documents-for-lookups)

Create reference document(1st level), that contains ids of another ref. documents(2nd level). This ref. docs on 2nd level will be your pages. If something is not clear, I am ready to explain more.

于 2013-09-20T11:21:31.820 回答
0

documentID 和 sourceDocumentID 都引用相同的 id,直到或除非在您的地图函数中创建视图时您明确引用了其他文档的 id,在这种情况下,您的文档 id 将被其他文档 id 覆盖,您仍然可以参考通过调用 sourceDocumentID 到原始 id

请参考这个链接,他们已经很好地解释了这里 http://developer.couchbase.com/documentation/mobile/1.1.0/develop/guides/couchbase-lite/native-api/view/index.html

于 2015-12-17T13:40:38.077 回答