Thanks for antswer,  it work.

Why store and get  only work with array, but not with object?
Ok i have now a solution but it think it's odd.

*Work:*

emit([doc.lom_id, doc.user], doc.value);
emit([doc.lom_id, 'all'],    doc.value);
/testdb/_design/rating/_view/get_rating?group=true&key=[1337, "all"]


*Dont work:*

emit({lom_id:doc.lom_id, user:doc.user}, doc.value);
emit({lom_id:doc.lom_id, user:'all'},    doc.value);

key = {"lom_id":"1337","user":"all"}
/testdb/_design/rating/_view/get_rating?group=true&key={%22lom_id%22%3A%221337%22%2C%22user%22%3A%22all%22}





Regards Heiko

Am 17.08.2011 18:40, schrieb Jens Alfke:
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

Reply via email to