(CBLModel instance).document.properties   is an NSDictionary.

    NSDictionary *dict = (SOME CBLModel Instance).document.properties;
    NSData* jsonData = [NSJSONSerialization dataWithJSONObject:dict
options:0 error:nil];
    NSString* jsonString = [[NSString alloc] initWithBytes:[jsonData
bytes] length:[jsonData length] encoding:NSUTF8StringEncoding];

That should work, haven't tried it though.  I'm doing something
similar, but manually building a dict from my keys because I don't
want the whole shebang getting serialized for my purposes.

-jeremy


On Wed, Sep 10, 2014 at 4:27 PM, Todd Freese <[email protected]> wrote:
> I need to be able to dump some of my CBLModels to a json file. Is there any
> easy method to call that will output the formatted json?
>
> Todd
>
> --
> 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/ff7b7546-7197-4946-a578-aab846661891%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
The Christian ideal has not been tried and found wanting;
it has been found difficult and left untried – G. K. Chesterton

-- 
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/CAN8S9i%2BYAv-dN5viwTF7euHCA6BstrfVyKXh_-_C-2-xfK4Cmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to