couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Wang <>
Subject map/reduce function question
Date Tue, 28 Apr 2009 02:32:44 GMT
Hi All,

While I am trying to switch my mind to map/reduce model while accessing
couchdb data, I found myself struggling.  Here is a simple question that you
guys might be able to answer:

If I have the following set of data in a doc:

{"name": "foo", "prop": "value1"}
{"name": "bar", "prop": "value2"}
{"name": "foo", "prop": "value3"}
{"name": "bob", "prop": "value4"}

How to write the map/reduce functions so that I can get a view which returns
the total number of unique name's?  In this case, the result should be 3.


-- Kevin

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