couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shorin <>
Subject Re: On Alternative View Engines
Date Tue, 02 Jul 2013 17:07:38 GMT
On Tue, Jul 2, 2013 at 8:31 PM, Russell Branca <> wrote:
> I like the link to JSON Pointer, Alexander, that's intriguing. Something
> like that could be very useful for simple views, although the RFC is quite
> vague on edge cases, ie how would you implement something like if (doc.type
> == "foo") emit(, doc.baz) with JSON pointer. Speaking of JSON
> pointer, looks like Jan beat us to the punch ;-)

JSON Pointer suggest to raise an error in case if pointer points to
the non existed value.
Probably, this case in DDL context will be like:

  with doc emit /bar, /baz if /type is "foo"


  with doc map(emit(/bar, /baz) for foo in /boo if /bar is null break)

a bit pythonic, but please don't shoot (:


View raw message