我正在使用Couchbase构建DocumentFragment[Lookup]
s的内存中缓存。通过使用子文档api,可以轻松做到这一点。
val fragment: DocumentFragment[Lookup] = bucket.lookupIn("key").get("some.path","some.other.path").execute()
Couchbase还具有用于从附加到JsonDocument
的副本中检索bucket
的接口。
val document: JsonDocument = bucket.getFromReplica("key",ReplicaMode.FIRST)
Couchbase API是否提供从副本中检索DocumentFragment[Lookup]
的方法?还是有任何将JsonDocument
转换为DocumentFragment[Lookup]
的辅助方法?最佳做法是什么?