> On Sep 1, 2014, at 6:47 AM, Toby UP <[email protected]> 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/52DC72CA-E282-4C41-BA1F-E287791C5FCC%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to