-1

I have a remote CouchDB named 'mydb', and a local PouchDB at client side sync with it. The situation is client can go offline and back, so during client offline, I DELETED the remote 'mydb' and re-create one with same name and added some random new files to the new db.

When the client come back online, is it going to sync back the old file and overwrite those with same name?

1
  • What happens when you try? Commented Jun 3, 2017 at 15:03

1 Answer 1

0

If you need bi-directional replication you might do:

// use "sync"
localDB.sync(remoteDB)

// another option is to use "replicate" with both "to" and "from"
localDB.replicate.to(remoteDB)
localDB.replicate.from(remoteDB)

If you need uni-directional replication, you might do:

// use "replicate" with only "to"
localDB.replicate.to(remoteDB)

Take a look at this.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.