incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From afshin afzali <a.afzali2...@gmail.com>
Subject Re: Newbie Question about View's Startkey Match
Date Thu, 01 Jul 2010 20:51:47 GMT
Yes, It is. The thing caused to ask you about that assumptions is, If I for
example emit an object key which contains many members (strings, objects,
arrays ,...) , in the case of don't care member, what should be place for
that member? ("" for a string member, {} for a object member and [] for a
array member)

-- afshin

On Fri, Jul 2, 2010 at 1:00 AM, Zachary Zolton <zachary.zolton@gmail.com>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 <a.afzali2003@gmail.com>
> 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 <a.afzali2003@gmail.com>
> >> 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
> >> >
> >>
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message