[
https://issues.apache.org/jira/browse/COUCHDB-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051672#comment-13051672
]
Filipe Manana commented on COUCHDB-1199:
----------------------------------------
Hi Andrew,
The filter is always relative to the source and its format is like
"ddocname/filtername", exactly like it is for _changes requests. I believe this
is documented somewhere in the wiki (for _changes requests at least).
One thing I find odd is that for scenario 2 you got the reply:
{"ok":true,"id":"test1_to_test2","rev":"1-97641b372d500d842688d217f97081da"}
But you don't see the doc in the _replicator database. This is odd since when a
document is rejected, via the default doc validate update function in
_design/_replicator document, you should get an explicit error message. For
your case, the document seems perfectly fine for this validate update function.
Can you query /_replicator/_all_docs and confirm the document is not there?
Ideally you could paste it here.
thanks
As a side note, when using curl you can surround the argument to -d in single
quotes, like this you avoid all that escaping which makes things harder to
read. E.g. curl ... -d ' {"source": "mysource", "target": "mytarget"} '
> Doc in _replicator db missing when using filter property
> --------------------------------------------------------
>
> Key: COUCHDB-1199
> URL: https://issues.apache.org/jira/browse/COUCHDB-1199
> Project: CouchDB
> Issue Type: Bug
> Components: Replication
> Affects Versions: 1.1
> Environment: Ubuntu 10.10
> Reporter: andrew henderson
>
> Scenario1 below works as expected, Scenario2 fails.
> Scenario1
> curl -X POST 'http://127.0.0.1:5984/_replicator/' -H "Content-Type:
> application/json" -d
> {\"_id\":\"test1_to_test2\"\,\"source\":\"my_culture\"\,\"target\":\"http:\/\/127.0.0.1:5984\/test2\"\,\"create_target\":\true\}{"ok":true,"id":"test1_to_test2","rev":"1-df297eda4880633bc0442590724014ff"}
> Doc is created in _replicator
> Replication completes successfully
> Scenario2
> curl -X POST 'http://127.0.0.1:5984/_replicator/' -H "Content-Type:
> application/json" -d
> {\"_id\":\"test1_to_test2\"\,\"source\":\"my_culture\"\,\"target\":\"http:\/\/127.0.0.1:5984\/test2\"\,\"create_target\":\true\,\"filter\":\"http:\/\/127.0.0.1:5984\/my_culture\/profile\/app_ddocs\"}
> {"ok":true,"id":"test1_to_test2","rev":"1-97641b372d500d842688d217f97081da"}
> Doc is not created in _replicator (in spite of 'ok' response above)
> No replication occurs.
> Now, I am not sure whether I got the right syntax in the filter property
> since I could find no documentation for it. In particular, whether the filter
> should be in the source db or _replicator. And do we use a full URL as above
> or just ddoc/filter name? The filter documented in Scenario2 does exist in
> source db.
> In any case, the doc in _replicator ought not to be getting lost as does
> happen.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira