Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B972C10ECC for ; Thu, 10 Oct 2013 00:04:26 +0000 (UTC) Received: (qmail 75184 invoked by uid 500); 10 Oct 2013 00:04:25 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 75148 invoked by uid 500); 10 Oct 2013 00:04:25 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 75140 invoked by uid 99); 10 Oct 2013 00:04:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Oct 2013 00:04:25 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.215.179] (HELO mail-ea0-f179.google.com) (209.85.215.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Oct 2013 00:04:19 +0000 Received: by mail-ea0-f179.google.com with SMTP id b10so762331eae.38 for ; Wed, 09 Oct 2013 17:03:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=eb7x+QzAIkNdp8968I6C5yaxwXt6ubkH6nkb2L16JB0=; b=UNLUC78qWfQmHV76kqi5FREsRqkQpbk6LyID2389C74lKGYsDR0x0iyV0V6NJdkYMO pgiWGgo8Fqot7BYnZ5sQ2ERqFimSD4lywYdBBwiyvmexoRHJKNpoTGQBvr95kP387nxm b1RdUUYaLr5wWqQyG2+s1mFFZleBrkW471xmJWDIjoxSl30ktixw9Y9BMsEMluhcNdVn OCoUnfvmcw7/Z1qh4r45JKnIkMMUCpTBCRYJPBWwYlmp7YTR+XJnUtcI/sA2tBm/h1BW fdnVBea5uXPqVz6Md3Jzia7NLgl1oKU2/V4+Im5c7vNuCbs0weaaq0KdMSeCXXnIpWRl CY+Q== X-Gm-Message-State: ALoCoQl8OlYOCSEA2lgTNNHKqVlFgel0f0YxggMSDIRLBgx9hSYTQCgKk1+2nLJaUBcw2nuKjMbT X-Received: by 10.15.75.73 with SMTP id k49mr15407240eey.36.1381363437110; Wed, 09 Oct 2013 17:03:57 -0700 (PDT) Received: from [192.168.2.112] ([77.72.35.178]) by mx.google.com with ESMTPSA id f49sm94336965eec.7.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Oct 2013 17:03:56 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1283) Subject: Re: Design Question: What is a Good Model? From: Filippo Fadda In-Reply-To: Date: Thu, 10 Oct 2013 02:03:54 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <9ABEE10B-FD12-43ED-9EDC-6C48DC1B0517@programmazione.it> References: To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1283) X-Virus-Checked: Checked by ClamAV on apache.org 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?=20