使用筛选器复制删除文档不起作用

时间:2017-07-17 16:33:04

标签: couchdb database-replication couchdb-futon

我正在尝试使用过滤器创建复制,以便删除CouchDB上已删除的文档,但我始终面临同样的错误。

这是我的filter

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

这是我的_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
}

我面临的错误:

       "_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}}}}}}"
            }

关于我做错了什么的想法

1 个答案:

答案 0 :(得分:0)

我忘记了网址上的端口,所以只需更改此行

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

这个

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