Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-673

Filtered replication

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.11
    • None
    • Replication
    • None
    • trunk / 0.11

    Description

      The following patch adds support for filtered replication.
      A replication object can now have 2 more optional fields: "filter" and "query_params".

      Example:

      {
      "source" : "sourceDB",
      "target" : "targetDB",
      "filter" : "mydesign/myfilter",
      "query_params" :

      { "param1" : "value", "param2" : int_value // etc... }


      }

      The filter must exist in the source DB, and it's the same type of filter as used by the _changes handler. The parameter "query_params" is used for adding fields to the req.query object passed as the second parameter to the filter function (like the query string parameters passed to _changes).

      The patch also does a refactoring of the _changes handler, allowing that code be used not only as an HTTP API but also as an internal API. The replicator now uses this internal API, allowing us to avoid copy-pasting code and have all the features of _changes available to the replicator.

      Attachments

        1. filtered-replication.patch
          36 kB
          Filipe David Borba Manana

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fdmanana Filipe David Borba Manana
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: