Search code examples
couchbase-java-api

Couchbase 2.5 SDK Java meta type issue


With Couchbase 1.4 SDK version, json datas are inserted with the meta type as json and non-json datas are inserted with the meta type as base64.

Couchbase 1.4 SDK Code:

OperationFuture<Boolean> setOp = client.set(_key, expiry, value);

Now we have upgraded to Couchbase 2.5 SDK version, and am using the below code to insert the datas into Couchbase. Here irrespective of json/non-json data, all the datas are inserted with the meta type as base64. Please help me in fixing this.

Couchbase 2.5 SDK Code:

if(isJSON(value)){  
    JsonDocument doc = JsonDocument.create(_key, JsonObject.fromJson(value.toString()));  
    inserted = bucket.async().upsert(doc).toBlocking().toFuture();  
}else{  
    LegacyDocument doc = LegacyDocument.create(_key, value);  
    inserted = bucket.async().upsert(doc).toBlocking().toFuture();  
} 

I am checking the meta type through couchbase view: enter image description here


Solution

  • With views in Couchbase server 5.1, we are always getting the meta.type as base64. Means Couchbase SDK is not playing any role here. Couchbase team is working with their engineering team on views issue. Please see the response I got from Couchbase support team. enter image description here