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