couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandre Paulo (JIRA)" <j...@apache.org>
Subject [jira] [Created] (COUCHDB-1469) Filtered replication dies with criteria values not "root"
Date Mon, 23 Apr 2012 15:31:34 GMT
Alexandre Paulo created COUCHDB-1469:
----------------------------------------

             Summary: 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


<< 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