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 B424FD833 for ; Mon, 1 Oct 2012 18:29:46 +0000 (UTC) Received: (qmail 58097 invoked by uid 500); 1 Oct 2012 18:29:45 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 58009 invoked by uid 500); 1 Oct 2012 18:29:45 -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 57998 invoked by uid 99); 1 Oct 2012 18:29:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2012 18:29:45 +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 (nike.apache.org: domain of kevin.r.coombes@gmail.com designates 209.85.219.52 as permitted sender) Received: from [209.85.219.52] (HELO mail-oa0-f52.google.com) (209.85.219.52) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2012 18:29:35 +0000 Received: by oago6 with SMTP id o6so4625492oag.11 for ; Mon, 01 Oct 2012 11:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:organization:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=7wFiIdh/w2Feju3A01ROZPVZf6GhmQoL0z6Q8MEjj5Q=; b=mJIJVxSHgDIF5CnG4dJfhVS1zCU3G8eP3BrFoB+L0lvBRvJ0Dsf34sbPOvPAjtsIil JGDh+wQUCpKSXy9HOk3QlST8Q6DfPkxiUDCNzjWTpeiIJEYT0zcR8SswUGNWs2eH2sSL cH0K5De7fQvEGhD8E1fA9+lCsysGJrHzycucCGcwYG7v507ZC9u3Fhr3H27H06mVWZzu EHL483QnxGh8vGCtRsChxDqLkaiK5emltI4G9RP+wEHrAMWtuhfBLD3CBeViLvXraiKp CAYChSJid5BY/X2c8W2x57/T1u952LIppmzhSErDacrQ9XewOUDx2syjkLRactkSOCBf 8M8g== Received: by 10.60.2.163 with SMTP id 3mr12670939oev.105.1349116155014; Mon, 01 Oct 2012 11:29:15 -0700 (PDT) Received: from [10.105.35.136] ([143.111.22.28]) by mx.google.com with ESMTPS id f4sm6772660obb.3.2012.10.01.11.29.13 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 01 Oct 2012 11:29:14 -0700 (PDT) Message-ID: <5069E0F8.3090906@gmail.com> Date: Mon, 01 Oct 2012 13:29:12 -0500 From: "Kevin R. Coombes" Organization: UT M.D. Anderson Cancer Center User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120312 Thunderbird/11.0 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: how to use view with key References: <201210020102190275925@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ... and so, if you want to search by the project (name), you need to create another view that emits that field as the key .... On 10/1/2012 1:17 PM, Robert Newson wrote: > Your view is keyed on "doc.todo.submitTime" not "doc.todo.project". > > B. > > On 1 October 2012 18:02, qaqabincs wrote: >> dear all, >> >> I have a view named as "todolist" such like: >> >> function(doc) { >> if (doc.todo.project){ >> emit(doc.todo.submitTime,doc); >> } >> } >> >> and the todo structure such as follow: >> >> todo: { >> content: "something", >> project: "aproject" >> } >> >> and I use couchdb.js to access my couchdb server: >> >> db.view("foo/todolist", { >> success: function(data){console.log(data);}, >> key: "aproject", >> reduce: false >> })' >> >> but as I have there document that has element project with value "aproject", but the return data is null. >> >> who can tell me what happened? I use CouchDB 1.1.1. >> >> >> >> >> qaqabincs