Ok thank you I understand. I think I may have to find another way rather 
than keeping a persistent record of every document received locally using a 
specific . Perhaps including the full dictionary of the 'source' document 
within the 'object' document until another solution comes to light. I think 
it could get very messy otherwise. Alternatively perhaps I could use 
CouchQuery's linked document functionality in my view as mentioned below to 
retrieve 'source' document data when querying 'object' documents.

On Monday, 1 September 2014 18:53:57 UTC+1, Jens Alfke wrote:
>
>
> On Sep 1, 2014, at 6:47 AM, Toby UP <[email protected] <javascript:>> 
> wrote:
>
> The majority of the 'source' documents won't exist locally. However if 
> they don't and I make a call to the local database via [database 
> documentWithID:] will it create a blank document and then subsequently pull 
> an existing document with that ID from the server seeing as it is now 
> created locally.
>
>
> Calling -documentWithID doesn't create a document in the database; it just 
> returns an empty instance of CBLDocument. The document will only be added 
> to the database if you subsequently save it.
>
> Also, the pull replicator doesn't care whether a document exists already 
> locally: it just downloads revisions created since the last replication, 
> which match the filter (if any). By creating  a blank doc locally, all 
> you're doing is creating a conflict with the real doc that gets pulled in, 
> and it'll be random which of those revisions 'wins' the conflict.
>
> If you have a set of doc IDs that you want to pull immediately, you should 
> create a new one-shot pull replication and set its documentIDs property. 
> Thereafter, to keep the docs up to date, you should run a continuous 
> replication whose documentIDs is set to all the documents that you've ever 
> brought in this way. (This is awkward but as I said, there isn't a clean 
> way to do it yet.)
>
> —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/bf43216b-ef5f-47e6-b604-777c37989a17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to