Migrating to spring data couchbase verison is 4.x. having few issues with StringDocument vs Transcoders implementation.
Also I went through the document
migrating-sdk-code-to-3.n.html
Where it is mentioned StringDocument -->replaced with RawStringTranscoder.
StringDocument had and id and content part.
I tried modifying the code referring the sample code given.
collection.upsert(docId, "hello world",
UpsertOptions.upsertOptions().transcoder(RawStringTranscoder.INSTANCE));
GetResult result = collection.get(docId,
GetOptions.getOptions().transcoder(RawStringTranscoder.INSTANCE));
String returned = result.contentAs(String.class);
My problem is earlier StringDocument was stored as a raw document in couchbase with an id which can be fetched like
myStringDocument; //StringDocument
myStringDocument.getDocument().id() //retreives and id.
How can I retrieve the Id say in above example with transcoders “docId”.
I am using RawStringTranscoder and replacing with StringDocument .Also fetching collection from bucket.getDefaultCollection.
Is this approach correct?Also how can I get id part from RawStringTranscoder implementation.
Do I have to use qualifier in case of multiple buckets when I autowire my Bucket bean.