couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filippo Fadda <filippo.fa...@programmazione.it>
Subject Re: Design Question: What is a Good Model?
Date Thu, 10 Oct 2013 00:03:54 GMT
If you just want return the user favorites of course, you can just emit userId as key and eventId
as value, but if you want show them ordered by timestamp (events belong in time), you must
include the timestamp in the key: emit([userId, timestamp], eventId). That because in CouchDB
the query results are _always_ ordered key.

-Filippo

On Oct 9, 2013, at 11:23 PM, Florian Westreicher Bakk.techn. wrote:
> Quick question: why would a complex key be required? Could we not emit (userid, eventid)
and be happy? 

Mime
View raw message