couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <B.Cand...@pobox.com>
Subject reduce=true ?
Date Mon, 20 Apr 2009 13:39:08 GMT
Whilst couchdb accepts reduce=false for a map+reduce view, it appears to
reject reduce=true

$ curl http://127.0.0.1:5984/xxxxxxxx/_design/cf896d6c31207fc142eee585fac3b435/_view/friends?reduce=true
{"error":"query_parse_error","reason":"Bad URL parameter: reduce=true"}

Is this intentional?

It works fine if I omit the reduce parameter entirely (i.e. I get the
reduced value as expected). But the include_docs and group parameters do
accept both false and true.

The sample design doc:

$ curl http://127.0.0.1:5984/xxxxxxxx/_design/cf896d6c31207fc142eee585fac3b435
{"_id":"_design/cf896d6c31207fc142eee585fac3b435","_rev":"1-2028769355","language":"javascript","views":{"friends":{"reduce":"function(ks,
vs, co) {\n  if (co) {\n    return sum(vs);\n  } else {\n    return vs.length;\n  }\n}\n","map":"function(doc)
{\n  if (doc.friend) {\n    emit(doc.friend, null);\n  }\n}              \n"}}}

The server version:

$ curl http://127.0.0.1:5984/
{"couchdb":"Welcome","version":"0.9.0a766377"}

Regards,

Brian.

Mime
View raw message