Reputation: 388
I am able to create BinaryDocuemnt in CouchBase dB using couch base java library.
JsonDocument doc = JsonDocument.create("document_id", JsonObject.create().put("some", "value")); System.out.println(bucket.insert(doc));
Can we store JsonDocument using Spring-data repository method ?
Upvotes: 0
Views: 94
Reputation: 28351
Spring Data offers an abstraction over the JsonDocument
, storing POJO as JSON, so one could say JsonDocument is supported indirectly. There is no support for BinaryDocument
, as this is orthogonal to Spring Data's concerns.
However you can transitively access the SDK from the Spring Data Couchbase CouchbaseRepository
and CouchbaseOperations
:
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
Upvotes: 1