So in order to read in my .json file I've generated, is it correct that since I have to create a new CBLDocument in order to call the new put method, that in order to add an attachment to it, I'll also have to create a new revision? So basically, the sequence will be:
1. Create new CBLDocument using the _id value from the JSON data. 2. Strip out and store the list of _attachments from the JSON data. 3. Call putExistingRevisionWithProperties:revisionHistory:fromURL:error: 4. Create a newRev CBLUnsavedRevision by calling [newDoc newRevision]. 5. Add the attachments by calling [newRev setAttachmentNamed:withContentType:contentURL:] 6. Save the newRev [newRev save:] 7. Lather, rinse, repeat :-) Does that make sense? It seems to me that maybe there would be a way to manufacture a revision based on the most recent revision history ID instead of creating a brand new revision. Especially since the source database of these documents would have already had a revision associated with these attachments and CBLDocument. Thanks! Brendan On Thursday, March 31, 2016 at 12:00:18 PM UTC-6, Jens Alfke wrote: > > > On Mar 31, 2016, at 1:37 PM, Brendan Duddridge <[email protected] > <javascript:>> wrote: > > One question though, if when I generate the export function I am adding a > "_revisions" string with a comma separated list of revision history IDs, do > I still need to provide the separate parameter of those revision history > IDs in that method? > > > Yes. The _revisions property is used in the REST API and replication > protocol, but that native method doesn’t recognize it. (In fact I think > you’ll need to remove that property before calling it, or it’ll complain > about the leading underscore.) > > —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/ab79de07-607a-4633-bd14-573def2c1318%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
