couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "Replication" by StephaneAlnet
Date Fri, 22 Mar 2013 18:17:55 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Replication" page has been changed by StephaneAlnet:
http://wiki.apache.org/couchdb/Replication?action=diff&rev1=52&rev2=53

Comment:
Added comment about filtered replications and deletions

  
  {"source":"http://example.org/example-database","target":"http://admin:password@127.0.0.1:5984/example-database",
"continuous":true}
  }}}
- CouchDB can persist continuous replications over a server restart. For more, see the {{{_replicator}}}
daatabase below.
+ CouchDB can persist continuous replications over a server restart. For more, see the {{{_replicator}}}
database below.
  
  === Cancelling a continuous replication task ===
  To cancel a continuous replication task, add "cancel":true parameter to JSON, for example:
@@ -106, +106 @@

    }
  }
  }}}
+ Note: this naive filter will lead to problems if used as-is with a source database in which
documents are deleted -- deletions will not be replicated (the document submitted to the filter
will not have a {{{type}}} field anymore, so the filter will return {{{false}}}), and if a
new document with the same {{{_id}}} is created later, it will not get replicated. A symptom
of this issue is an incrementing {{{missing_revisions_found}}} counter in a replication process.
+ Deleted documents have a {{{_deleted}}} field though; a better filter might be:
+ {{{
+   function(doc, req) {a
+   if(doc._deleted) {
+     return true;
+   }
+   if (doc.type && doc.type == "foo") {
+     return true;
+   } else {
+     return false;
+   }
+ }
+ }}}
+ 
+ 
  Filters live under the top-level "filters" key;
  
  {{{

Mime
View raw message