문제

I'm attempting to replicate my local CouchDB database with a remote database that lives on iriscouch.com. I'm using nano.

This works fine -- except that the local documents are added to the existing iriscouch database rather than the local database being replicated on the remote.

Am I missing something?

Relevant code below.

nano.db.replicate(localCouchName, remoteCouchName,
  function(error, body) {
    if (error) {
    console.log('nano.db.replicate() error:', error);
    } else {
      console.log('nano.db.replicate() success', body);
    }
});
도움이 되었습니까?

해결책

Replication is an additive operation, not a replacing operation. If you want your state on the remote to be exactly like the local state without any regard for what's currently on the remote node, you should probably just remove the database on the remote node prior to doing the replication.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top