我可以使用沙发基础java库在CouchBase dB中创建BinaryDocuemnt。
JsonDocument doc = JsonDocument.create(" document_id",JsonObject.create()。put(" some"," value")); 的System.out.println(bucket.insert(DOC));
我们可以使用Spring-data存储库方法存储JsonDocument吗?
答案 0 :(得分:1)
Spring Data提供了对JsonDocument
的抽象,将POJO存储为JSON,因此可以说间接支持JsonDocument。不支持BinaryDocument
,因为这与Spring Data的问题是正交的。
但是,您可以从Spring Data Couchbase CouchbaseRepository
和CouchbaseOperations
传递访问SDK:
CouchbaseRepository<String> couchRepo;
// ^ note this is the explicit couchbase interface for repositories
Bucket bucket = couchRepo.getCouchbaseOperations().getCouchbaseBucket();
//work directly with the couchbase Bucket SDK from here