incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zachary Zolton <zachary.zol...@gmail.com>
Subject Re: map reduca with object as key
Date Wed, 17 Aug 2011 21:03:05 GMT
The ordering of object properties for view key collation is defined,
however there's no reason to assume your favorite language's JSON
library will match that ordering.

On Wed, Aug 17, 2011 at 12:04 PM, Robert Newson <rnewson@apache.org> wrote:
> 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