Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 15975 invoked from network); 10 Feb 2010 06:31:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Feb 2010 06:31:17 -0000 Received: (qmail 70744 invoked by uid 500); 10 Feb 2010 06:31:15 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 70580 invoked by uid 500); 10 Feb 2010 06:31:15 -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 70570 invoked by uid 99); 10 Feb 2010 06:31:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2010 06:31:15 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mrtrick@gmail.com designates 209.85.210.189 as permitted sender) Received: from [209.85.210.189] (HELO mail-yx0-f189.google.com) (209.85.210.189) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2010 06:31:06 +0000 Received: by yxe27 with SMTP id 27so4885398yxe.29 for ; Tue, 09 Feb 2010 22:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=vmItOjasEQIM3ur0jMAUSQmSD2D0NN8VN2MUxmkocAw=; b=MtuheltwMqKVE8LZA2SZwPEG7IXIVKDUKSYaEt4JQd7hcLXOR9iYHO4bnIqubGs1U/ RPlOf+IipQ/NZU7QnOFuQI9eZNIoLCLItpOpBcxUfbzlm7HGzhvB5n0u8kRI2IurGvtJ N/qtHAGf5vgiJ889qXPkdKDYbbVDHP+gG4TFY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=XwRt8I0qEoCrcWf7bb1XZ/Nz9Z81VExf2HopJyPA3zicB/A6ot94aTarqsv37kUMxW lWxSJoRAEPdCKqd1aSceUUmuWTuFkiaN8IIdbEX9vu3OcK+uZXrzXknou7mBdSaqkCkR bpZLDA+XgS6i9OJdOuxBDa6la88ALTJbu18xY= Received: by 10.151.17.33 with SMTP id u33mr1598243ybi.298.1265783445160; Tue, 09 Feb 2010 22:30:45 -0800 (PST) Received: from ?138.25.13.137? (dhcp-13-137.it.uts.edu.au [138.25.13.137]) by mx.google.com with ESMTPS id 7sm344084yxd.8.2010.02.09.22.30.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 09 Feb 2010 22:30:44 -0800 (PST) Message-ID: <4B725289.5010705@gmail.com> Date: Wed, 10 Feb 2010 17:30:33 +1100 From: Patrick Barnes User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Lightning/1.0b1 Thunderbird/3.0 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: parametrized view generation References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi madhav, Typically, you create a view where the key is the data you want to filter on, and the value is the data you want to retrieve. eg: If you have a big db of people, and you want to be able to look up people by their phone number, and will want to display at least their names: map = function(doc) { emit(doc.phone, doc.name); } To find the name of a person who has the phone number 12345678, send a request to: http://localhost:5984/dbpeople/_design/dbpeople/_view/by_phone_number?key=12345678 If you want to see more than just their name: http://localhost:5984/dbpeople/_design/dbpeople/_view/by_phone_number?key=12345678&include_docs=true (the include_docs parameter will include the entire document in the returned data.) On 10/02/2010 4:44 PM, madhav sharma wrote: > hi everyone > I am couchdb for one of my project and i am stuck at a place where i need > your help. > My use case of problem is that i have a set of documents which have same > field with different value and i need to get the value of field (say name) > from a document with id (say information) , and i want this mapfunction to > be generic so that i can call this with different document id and get the > the field value out of it. > In sql it can just be( select name from Table where id = 1233 ) so any > help is appreciated > > Thanks >