couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: map reduca with object as key
Date Wed, 17 Aug 2011 17:04:46 GMT
The ordering of object keys is explicitly defined here;

http://wiki.apache.org/couchdb/View_collation#Collation_Specification

B.

On 17 August 2011 17:40, Jens Alfke <jens@couchbase.com> wrote:
>
> On Aug 17, 2011, at 12:09 AM, Heiko Henning wrote:
>
> Is there a possibility to have key as Object?
>
> Or have i to do thinks like:
>
> emit(doc.lom_id+'___'+user:doc.user, doc.value);
> emit(doc.lom_id+'___all', doc.value);
>
> Usually people use arrays, not objects, as composite keys. Keys are sorted, after all,
and it’s kind of unclear how to sort objects since the key-value pairs have no intrinsic
order.
>
> So try something like emit([doc.lom_id, user:doc.user], doc.value);
>
> —Jens
>

Mime
View raw message