2014-02-09 21 views

回答

1

CouchDb docs

從CouchDB的1.2.0版本開始,原來的複製對象 不再需要知道。相反,使用 字段「replication_id」(字符串)和「取消」(設置爲布爾值 真值)的簡單JSON對象就足夠了。名稱_local_id和id是 replication_id的別名。可以從原始的 複製請求(如果它是連續複製),從 _active_tasks或從日誌中獲取複製ID。例如:

$ curl -H 'Content-Type: application/json' -X POST http://localhost:5984/_replicate -d ' {"source": "http://myserver:5984/foo", "target": "bar", "create_target": true, "continuous": true} ' 
{"ok":true,"_local_id":"0a81b645497e6270611ec3419767a584+continuous+create_target"} 

$ curl -H 'Content-Type: application/json' -X POST http://localhost:5984/_replicate -d ' {"replication_id": "0a81b645497e6270611ec3419767a584+continuous+create_target", "cancel": true} ' 
{"ok":true,"_local_id":"0a81b645497e6270611ec3419767a584+continuous+create_target"}