Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 94427 invoked from network); 1 Jul 2010 21:09:26 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Jul 2010 21:09:26 -0000 Received: (qmail 114 invoked by uid 500); 1 Jul 2010 21:09:24 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 99964 invoked by uid 500); 1 Jul 2010 21:09:24 -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 99956 invoked by uid 99); 1 Jul 2010 21:09:24 -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 21:09:24 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of robert.newson@gmail.com designates 209.85.161.52 as permitted sender) Received: from [209.85.161.52] (HELO mail-fx0-f52.google.com) (209.85.161.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 21:09:16 +0000 Received: by fxm8 with SMTP id 8so2747504fxm.11 for ; Thu, 01 Jul 2010 14:08:56 -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=X7JHKQwwWVo9t9dmxxDGRoZWGY65MXzzkuKAebMVqcM=; b=YLpbw7UytvIYuKQjmKBvHQTDtu9XtMccIzXO/HIuIbvBNEeaXxwKB3Q7va+5XxZeZt YGOsQiR6/5ThkPQl+N2ZFO97qn6neFwRUtAQ5RVvd6tTO77w4vIgVvc0HMmaU1n9NOfe UyXUREfGbZVL1XIt4LvxS9j5hhvq9p/ArhjsE= 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=ZLTi/BIy1QlXro2WaBE14sr4IB+Bjs6Xcm2L84zKhiYf5sYwKBfMC1kKkPRlXVansi JlwxlqnKbi35b41VVEP4Q0ZxRyrsvp1xVT2uvX7NC0r66BroHc6VCqmvTqzWI7SV/wK9 00KvmMiQLMSJCwUTubpuUiX/ykTzVZgUP0DjE= MIME-Version: 1.0 Received: by 10.102.228.9 with SMTP id a9mr27287muh.6.1278018536277; Thu, 01 Jul 2010 14:08:56 -0700 (PDT) Received: by 10.103.224.9 with HTTP; Thu, 1 Jul 2010 14:08:56 -0700 (PDT) In-Reply-To: References: Date: Thu, 1 Jul 2010 22:08:56 +0100 Message-ID: Subject: Re: Newbie Question about View's Startkey Match From: Robert Newson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Afshin, There is no "don't care key", only keys that sort before or after than the items you are interested in. I could explain this more clearly if you had a specific example. B. On Thu, Jul 1, 2010 at 10:00 PM, afshin afzali wrote: > Hi Robert, > > You mean if I want to be able to use a don't care key for example for any of > my arrays, I should insert a fixed constant element in all of them ? > > -- afshin > > On Fri, Jul 2, 2010 at 1:19 AM, Robert Newson wrote: > >> Afshin, >> >> Unfortunately, none of your four assumptions are correct. >> >> CouchDB supports key and key range lookup only, there is no syntax for >> "match all arrays" or "match all objects". >> >> What you have probably seen is this trick; >> >> ?startkey=["foo"]&endkey=["foo",{}] >> >> which, in most circumstances, selects all array keys where the first >> item is a string of "foo". This works because shorter arrays sort >> before longer arrays and {} (empty object) sorts later than any >> possible string. >> >> As Zachary pointed out above, the view collation is described at >> http://wiki.apache.org/couchdb/View_collation. >> >> B. >> >> On Thu, Jul 1, 2010 at 9:30 PM, Zachary Zolton >> wrote: >> > Afshin, >> > >> > Well, if you want to just get a certain "slice" of a view's key space, >> > you'll want to use both the startkey and endkey parameters. >> > >> > For instance, if you just want all the view rows where the key >> > contains an array, try this: >> > >> > startkey=[]&endkey={} >> > >> > Any array value (e.g. ["foo"] or ["foo","bar"]) will collate at or >> > after the empty array (i.e. []), and since in this example you don't >> > want any object keys coming through we stop at the empty object (i.e. >> > {}). >> > >> > Is this any clearer? >> > >> > -Zach >> > >> > On Thu, Jul 1, 2010 at 3:04 PM, afshin afzali >> wrote: >> >> Thank you, I've saw this page already. My question is based on that >> page. >> >> Are you confirm my assumtions ? >> >> >> >> >> >> >> >> >> >> On Fri, Jul 2, 2010 at 12:26 AM, Zachary Zolton < >> zachary.zolton@gmail.com>wrote: >> >> >> >>> Here's the overall ordering of collation: >> >>> http://wiki.apache.org/couchdb/View_collation#Collation_Specification >> >>> >> >>> On Thu, Jul 1, 2010 at 2:31 PM, afshin afzali >> >>> wrote: >> >>> > Hi Guys, >> >>> > >> >>> > These are some simple assumptions which I would be confirmed when >> using >> >>> in >> >>> > startkey param: >> >>> > >> >>> > 1) {} matches all object keys ( including {} ) >> >>> > 2) [] matches all array keys (including [] ) >> >>> > 3) "" (null string) matches all string keys (including "") >> >>> > 4) {} at the end of complex key matches all of remained ones >> >>> > >> >>> > BEST >> >>> > -- afshin >> >>> > >> >>> >> >> >> > >> >