I have com.google.gson.JsonObject to store in couchbase. Directly I can not store this type of object. I am using following code.
public RawJsonDocument put(final String key, final JsonObject googleJsonObject) {
try {
RawJsonDocument subscriberDocument = RawJsonDocument.create(key, googleJsonObject.toString());
return bucket.upsert(subscriberDocument);
} catch (Throwable th) {
return null;
}
}
I am not happy with the above code. It is quite slow. How to make it better?