- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在使用 Couchbase-Java SDK 2.7.1 并尝试对文档键集执行批量子文档操作。下面的代码没有抛出任何错误,但是在执行给定代码后文档没有得到更新。
/*
Document structure:
{
"key1": "",
"key2:: ""
}
*/
List<String> docIds = new ArrayList<String>();
docIds.add("mydoc-1");
docIds.add("mydoc-2");
String docPath = "key1";
String value = "myVal";
Observable<String> docIdsObs = Observable.from(docIds);
Observable<DocumentFragment<Mutation>>
subdocAppendObs =
docIdsObs.flatMap(docId -> this.subdocUpsert(bucket, docId, docPath, value,
persist, replicate, timeout,
timeunit));
最佳答案
正如 dnault 在评论中所建议的那样,您永远不会触发 Observable
以实际开始操作。执行流程将设置 Observable
并继续,因此如果仅此而已,您的应用程序将退出。
如果您的应用被设计为异步使用输出,您可以只添加 subscribe
的一种变体。
如果你想阻塞直到操作完成,你会想使用倒计时锁存器,或者你可以做类似的事情
List<DocumentFragment<Mutation>> result = docIdsObs.flatMap(docId -> this.subdocUpsert(bucket, docId, docPath, value,
persist, replicate, timeout,
timeunit));
.toList()
.toBlocking()
.single();
这将阻止并在一个列表中生成所有结果。
关于java - Couchbase批量子文档操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54844006/
我有看起来像这样的文件: { "name": "n", "age": 22 //other properties "hash": "XyRZHDJJD6738..." //This property
有下一个对象 "a" : { "id" : "1", "arr" : [ {"id" : "b1"}, {"id" : "b2"} ] } "b1" : { "id" : "b
Couchbase 文档说“磁盘持久性使您能够执行备份和恢复操作,并使您能够将数据集增长到比内置缓存层更大的数据集”,但我似乎无法让它发挥作用。 我正在一个三节点集群上测试 Couchbase 2.5
我搜索了有关 Couchbase 如何在集群内实现强一致性的解释。这一切都是因为使用了membase吗? 最佳答案 顺便说一句,Couchbase 是 membase。 Couchbase 是一个产品
我有以下格式存储的 couchbase 文档: { "userEmail": "satyam@xyz.com", "hashedPassword": "$2a$12$MT31FHNEbOAKpQGzL
请在下方找到有关 Couchbase 产品路线图的问题。 上下文 我目前正在研究一项将现有系统(后端应用程序和移动应用程序)转变为 Multi-Tenancy 应用程序的功能。 堆栈将是: 沙发底座
什么是 Couchbase,什么是 Couchbase Lite?两者之间有什么区别吗?如何在移动设备中创建 couchbase lite 以及如何与服务器通信? 最佳答案 你碰巧知道CouchDB
我正在寻找一种使用 Spring Data Couchbase 连接到两个单独的 Couchbase 集群的方法。查看文档和实现,不清楚如何执行此操作,我担心如果有两个扩展 AbstractCouch
我想使用 couchbase lite 和 couchbase syncgetway 在 nodejs 中开发一个 CRUD 应用程序。我想在 Raspberry-pi 上运行这个 Node js 应
我在 couchbase 存储桶中有具有这种结构的文件: "name": { "grandfather": { "parent1": { "ch
我有一个依赖于另一个的文件。第一的: { "doctype": "closed_auctions", "seller": { "person": "person11304" },
我以前使用过 couchdb 并且非常喜欢它的 UI,因为我可以直接在 UI 中创建 View 并测试它们并查看文档。 因为,我需要扩展,所以我开始使用 couchbase。但是,在安装 couchb
我的环境中有一个二级索引(没有复制),我想知道如何在不删除索引的情况下创建复制? 我不想删除索引并用副本重新创建它,因为我没有使用主索引,因此有约束。 谢谢 最佳答案 即将发布的 6.50 版本您可以
我正在考虑将 couchbase 用于我的下一个 Web 应用程序,我想知道我的数据应该如何构建,特别是存储桶的使用。例如,假设每个用户将拥有大量唯一数据,是否应该为每个用户创建一个单独的存储桶(甚至
我正在开发一个小型 express 应用程序,目前允许用户登录(通过护照)并查看有关他们 friend 的信息,即购买历史记录、喜欢等。理想情况下,我希望每个用户都有一个随附的个人资料照片和他们购买的
对于 Cassandra,假设复制因子为 1(即数据集的两个副本),至少需要三个节点才能启用具有强一致性的写入。 Couchbase 似乎没有这个要求,至少我没有在任何地方找到它。尽管如此,Couch
我正在使用 Couchbase 存储桶,其中所有文档都使用 DocType 保存。标识包含什么类型的数据的属性。我想执行一个查询,从每个 DocType 给我一个结果, 用作所有文档类型的示例。 我可
无法更改 Couchbase 控制台的端口号。默认为 8091。我试图在已知的 static_config 文件中附加一行。这条线就像- {rest_port, 9000}. 这是我缺少文件的屏幕。
我想使用 Couchbase,但我想在一些类似于 RethinkDB 的方式实现更改跟踪。 似乎有很多方法可以将更改从 Couchbase 服务器推送给我。 DCP 点击 XDCR 哪一个是正确的选择
我有一个 couchbase 文档,id 为 x x 没有子文档,因为在一些子文档操作中都被删除了,它是这样的 {} 我想删除所有没有子文档的空文档。是否可以在 couchbase 中使用 N1QL
我是一名优秀的程序员,十分优秀!