couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Per Ejeklint <ejekl...@mac.com>
Subject View woes - no keys after reduce
Date Thu, 18 Feb 2010 16:43:29 GMT
I'm a bit confused. Running CouchDBX latest, trunk 910791. With this map/reduce functions

function(doc)
{
	if (doc.docType == "PersonAndOrganizationDoc")
	{
		emit(doc.organizations.organization[0].name, doc.persons.person.length);
	}
}

function(keys, values)
{
    return sum(values);
}

I get this from http://localhost:5984/paodb/_design/view1/_view/byName?reduce=false:

{"total_rows":6,"offset":0,"rows":[
{"id":"4fa43f2ba6fa2fb9e7b1dd1fcb680796","key":"JanLs AB","value":3},
{"id":"4fa43f2ba6fa2fb9e7b1dd1fcb67e4dd","key":"Lottas AB","value":3},
{"id":"4fa43f2ba6fa2fb9e7b1dd1fcb67e62d","key":"Lottas AB","value":3},
{"id":"4fa43f2ba6fa2fb9e7b1dd1fcb67f207","key":"Lottas AB","value":3},
{"id":"4fa43f2ba6fa2fb9e7b1dd1fcb67fb0b","key":"Nisses AB","value":3},
{"id":"4fa43f2ba6fa2fb9e7b1dd1fcb67ff49","key":"Nisses AB","value":3}
]}

Which looks ok to me. Then with reduce=true I get

{"rows":[
{"key":null,"value":18}
]}

The sum is ok, but I can't figure out what happened with my keys. Tell me I'm stupid - what
have I missed?

/Per


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message