> On Oct 22, 2014, at 4:43 AM, Tim Clarke <[email protected]> wrote:
> 
> However, our Couchbase docs are all JSON and when we retrieve them from 
> Couchbase Lite they are returned as a dictionary of properties with the JSON 
> having been split into individual properties. This is clever, but not quite 
> what we want. We need the raw JSON string.

(I have a weird feeling that I already answered this exact question a week ago; 
are you reposting?)

If you want the document in JSON form, use NSJSONSerialization to encode the 
dictionary. (I'm not sure why you'd want that, though; are you just going to 
send it to some other API to parse it again?)

> Is there any way to access the raw JSON document in Couchbase Lite?  (And if 
> not, could this be a new feature in a future release?)


There's not really any such thing as the "raw" JSON. The JSON coming in from 
the server gets parsed and transformed during document insertion, and the 
version stored in the database file has had bits spliced out of it (all the 
metadata properties) that then get reconstituted when it's loaded. I have some 
future optimizations I've been prototyping in which the storage format won't 
even be even JSON at all anymore but a binary format that's more efficient to 
parse.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/9F02C74C-AABF-4DF6-8DDE-BB3D33D3E46F%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to