incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Woodward <m...@mattwoodward.com>
Subject Re: Map/Reduce Question
Date Thu, 02 Dec 2010 19:50:18 GMT
On Thu, Dec 2, 2010 at 11:28 AM, Adam Kocoloski <kocolosk@apache.org> wrote:

> You need to perform the query with ?group=true.  Best,
>

Thanks! Closer, but now I'm only getting one result per key which isn't
quite what I need.

When I added group=true I now get:
{"rows":[
{"key":"key1","value":["hi","there"]},
{"key":"key2","value":["this","is"]},
{"key":"key3","value":["your","data"]}
]}

In and of itself that's fine. The issue is that there are records within
each key1 that have a *different* value that aren't getting included.

So what I'm hoping to see is something like this:
{"rows":[
{"key":"key1","value":["hi","there"]},
{"key":"key1","value":["it is","sunny"]},
{"key":"key2","value":["hi","there"]},
{"key":"key2","value":["it is","raining"]},
{"key":"key3","value":["hi","there"]},
{"key":"key3","value":["couchdb","rox"]}
]}

In other words it's currently only showing one record per key, even if there
are records within each key with different values. Now if there is a record
with a different key but the same value (which is why I used "hi","there" in
the example for all the keys), then it *should* be included, and that is
currently working. The only part that isn't working is it isn't including
multiple distinct values for each key.

Thanks so much for the input thus far--very helpful as I learn CouchDB.

-- 
Matthew Woodward
matt@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

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