From user-return-11236-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Thu Jul 01 22:08:15 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 12662 invoked from network); 1 Jul 2010 22:08:15 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Jul 2010 22:08:15 -0000 Received: (qmail 97904 invoked by uid 500); 1 Jul 2010 22:08:14 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 97721 invoked by uid 500); 1 Jul 2010 22:08:13 -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 97708 invoked by uid 99); 1 Jul 2010 22:08:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 22:08:13 +0000 X-ASF-Spam-Status: No, hits=4.4 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_FILL_THIS_FORM_SHORT,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of a.afzali2003@gmail.com designates 209.85.214.52 as permitted sender) Received: from [209.85.214.52] (HELO mail-bw0-f52.google.com) (209.85.214.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 22:08:05 +0000 Received: by bwz14 with SMTP id 14so3521bwz.11 for ; Thu, 01 Jul 2010 15:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=spB5jjIrqNWydVq8a+WYIFyCdGN4T+NObTyQA8unO+w=; b=Ru89CEiOQqGUKGwXxIUCoxfec8lXEjxI1rNJhCdO3Iph+7ObILKUYaahhR1mhu6RnS E1dDbSHb391GHqNPykz8fKSnmeRT60W4yv9KhNmjyzYI6LkKvFm4hDij2qNFl60XxO7I KRxvHsuMQpuj760SIzfMXc6/g4uXfuORP8hbQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=VdhyiwjT+XhyRPALiwfSI1UF4ytEdZEC+UL1Ceue51fPKXTgvjBwg6PMhC/EaWnxit qsP0jJaPzuo+Fzw9/i9nS7AL0Zj6GbylXpFTCZItEUqy991KRNzpulXE+OC5PI1Bu5H8 gasy81qBUvxlgKLVeEewJ/XRiPtozdc781+hA= MIME-Version: 1.0 Received: by 10.204.126.82 with SMTP id b18mr82365bks.124.1278021648272; Thu, 01 Jul 2010 15:00:48 -0700 (PDT) Received: by 10.204.65.2 with HTTP; Thu, 1 Jul 2010 15:00:48 -0700 (PDT) In-Reply-To: References: Date: Fri, 2 Jul 2010 02:30:48 +0430 Message-ID: Subject: Re: Newbie Question about View's Startkey Match (Forked) From: afshin afzali To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=005045017bd35c4ce5048a5a9ad5 X-Virus-Checked: Checked by ClamAV on apache.org --005045017bd35c4ce5048a5a9ad5 Content-Type: text/plain; charset=ISO-8859-1 This is ok, But in real world my problem is more complicated. In my project, there is a CONTACT document that will contains all information that somebody may has: Name(First, Middle, Last, Nick), Phone(Home, Work, Cell..) Addresses(Home, Work, ...) Emails, IM(s), ... So we should provide a search page which contains all search items that user may use to retrieve desired contact. I was thinking that I could emit all of searchable information of CONTACT document, then when I query my view just insert those data which provided by user and use some don't care notaion for others :( -- afshin On Fri, Jul 2, 2010 at 2:15 AM, Robert Newson wrote: > You'll need to emit the last name first so that the items with the > same last name sort together. > > function(doc) { > emit([doc.lastname, doc.firstname], null); > } > > and then query with ?startkey=["Afzali"]&endkey=["Afzali",{}] > > more simply; > > function(doc) { > emit(doc.lastname, null); > } > > and then query with ?key="Afzali" > > B. > > > On Thu, Jul 1, 2010 at 10:29 PM, afshin afzali > wrote: > > Sorry, But I don't know why list rejects my post!!! > > > > Ok, assume we have three object keys which emited by a view; > > > > { "FirstName" : "Afshin", "LastName" : "Afzali" } > > { "FirstName" : "Omid", "LastName" : "Afzali" } > > { "FirstName" : "Ashkan", "LastName" : "Afzali" } > > > > I want to retreive all docs which have LastName == "Afzali" > > -- afshin > > > --005045017bd35c4ce5048a5a9ad5--