couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Cottlehuber (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-1469) Filtered replication dies with criteria values not "root"
Date Mon, 23 Apr 2012 17:44:33 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-1469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13259766#comment-13259766
] 

Dave Cottlehuber commented on COUCHDB-1469:
-------------------------------------------

In this and a number of other areas such as view/filter/changes/replication,  logging the
doc.id that fails or generates an exception would be handy. Thoughts?
                
> Filtered replication dies with criteria values not "root"
> ---------------------------------------------------------
>
>                 Key: COUCHDB-1469
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1469
>             Project: CouchDB
>          Issue Type: Question
>          Components: Replication
>    Affects Versions: 1.2
>            Reporter: Alexandre Paulo
>            Priority: Minor
>              Labels: replication, replication_crash_with_filter
>
> << Excuse my english... I am portuguese >>
> I have a document structure that goes like this:
> {
>    "Location": {
>        "City": ...,
>        "Region": ...,
>        "Country": ...
>    }
> }
> I'd like to replicate my documents based on "Region", so, I wrote a filter function with
> if (doc.Location.Region && doc.Location.Region == ...) {
>    return true;
> } else {
>    return false;
> }
> But the replication dies with  {"error":"changes_reader_died"}
> I tested my function as a Map function on a view, just replacion "return true" with "emit
(true)" and "return false" with "emit (false)" and it works fine.
> After some testing I came to the conclusion that the replication filter function works
fine with first-level fields (e.g. "doc.field") but dies with multi-level fields (e.g. "doc.parent.field")
> In other words it does not compute "doc.Location.Region" on my filter function. I had
to change my document structure to have "doc.Region".
> Now my questions:
> - is this a bug or is it intended to work this way?
> - if it is intended why is it allowed on Map functions, but not on filter functions?
> Thanks a lot!
> << Excuse my english... I am portuguese >>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message