I’ve exhausted google and this forum and I can’t find a way to accomplish something that used to be possible in the 2.x versions of the Java SDK. I want to use lookupIn to get sub docs out of a larger JSON document, but I want the result back in a plain jane JSON string.
This is for the CFCouchbase SDK which is written in CFML and wraps the Java SDK. CFML has its own JSON serializers and deserializers which deal in native datatypes to the language. The trick is I need something
- generic (This is an SDK for CF developers which can be used in any way imaginable)
- that will work for any data type that may be coming back (array, object, string, boolean, etc)
- and I don’t know what the value is ahead of time
This rules out using the
contentAsArray() methods since I don’t know what random values the user may be targeting with their path. I can’t use
contentAs( index, class ) as well since I don’t know the type of data.
For all other get() kv operations, I use the
RawStringTranscoder as my default transcoder, which allows me to handle the JSON deserialization myself. But the
LookupInOptions do not accept a transcoder. It only allows me to set a
JsonSerializer which does not help me since I don’t want the Java SDK doing any sort of deserialization on the JSON!.
How can I get back a raw JSON string from the
lookupIn() method for any path without knowing ahead of type what type of data is coming back?