Hi.
Can anyone tell me why this works:
{
"_id": "_design/first_filter",
"_rev": "24-a6c1822c543f96d1bf4803112092e9ae",
"filters": {
"filter1": "function(doc, req) {if (doc.abc === \"xyz\") {return
true;}else{return false;}}"
},
"language": "javascript"
}
and this does not:
{
"_id": "_design/first_filter",
"_rev": "24-a6c1822c543f96d1bf4803112092e9ae",
"filters": {
"filter1": "function(doc, req) {if (doc.def.ghi === \"jkl\") {return
true;}else{return false;}}"
},
"language": "javascript"
}
In the second case I get:
[error] 2017-02-07T18:55:40.384000Z couchdb@localhost <0.32487.361>
f201ca664a OS Process Error <0.18298.118> ::
{<<"TypeError">>,{[{<<"message">>,<<"doc.def is undefined">>}
I'm using v2.0.0 on Windows and running a filtered replication using curl.
The documents contain the relevant structure and all documents contain
"abc", and "def.ghi" and have values.
Many thanks.
John