JoCuTo
JoCuTo

Reputation: 2483

Removing documents with filter replication does not work

I am trying to create a replication using a filter in order to remove the deleted documents on CouchDB but I am always facing the same error.

This is my filter :

 "deletedfilter": "function(doc, req) { return !doc._deleted; };",

this is my _replicator:

{
   "_id": "replicateCleanup",
   "source": "http://myuser:mypass@l@localhost/a",
   "target": "http://myuser:mypass@localhost/b,
   "create_target": true,
   "filter": "filters/deletedfilter",
   "owner": "myuser",
   "continuous": false
}

And the error I am facing:

       "_replication_state": "error",
               "_replication_state_time": "2017-07-17T18:07:49+02:00",
               "_replication_state_reason": "Could not open source database 
        `http://myuser:*****@localhost/a/`:
     {'EXIT',\n    {http_request_failed,\"HEAD\",\n        \"http://myuser:*****@localhost/a/\",\n     
   {error,{error,{conn_failed,{error,econnrefused}}}}}}"
            }

Any idea about what I am doing wrong

Upvotes: 0

Views: 178

Answers (1)

JoCuTo
JoCuTo

Reputation: 2483

I forgot the port on the URL ,so just change this lines

  "source": "http://myuser:mypass@l@localhost/a",
   "target": "http://myuser:mypass@localhost/b,

for this ones

 "source": "http://myuser:mypass@l@localhost:5984/a",
 "target": "http://myuser:mypass@localhost:5984/b,

Upvotes: 1

Related Questions