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 Mon, 06 Dec 2010 22:49:25 GMT
On Mon, Dec 6, 2010 at 2:27 PM, Aurélien Bénel <aurelien.benel@utt.fr>wrote:

> Create a view with the following map function:
>  function(o) {
>     emit(o.lastName, o);
>  }
>
> Then call the view with:
>  ?key="Woodward"
>
> ... or maybe I don't understand your question?
>

Well, I've kind of come full circle here and I probably oversimplified my
latest example. :-)

Earlier in the thread I have the problem whittled down to getting distinct
values for some redundant data across documents, which involved a simple
reduce function with rereduce, and to do that I need to emit a key that's an
array of multiple document fields. I definitely don't want to return the
entire document in this case since the documents might have reams and reams
of additional data I don't need here since this is ultimately being used to
drive a select box.

Thanks for the input--looks like the follow-up from Zachary covers the
answer--startKey and endKey that are the same should do the trick.

Appreciate everyone's assistance on this--very helpful as I go from "noob"
to "dangerous noob" with 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