On Tue, Jul 2, 2013 at 10:07 AM, Alexander Shorin <kxe...@gmail.com> wrote:
> On Tue, Jul 2, 2013 at 8:31 PM, Russell Branca <chewbra...@apache.org> > 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.bar, doc.baz) with JSON pointer. Speaking of JSON > > pointer, looks like Jan beat us to the punch ;-) > > https://github.com/janl/erl-jsonpointer > > 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" > > loops: > > with doc map(emit(/bar, /baz) for foo in /boo if /bar is null break) > > a bit pythonic, but please don't shoot (: > > -- > ,,,^..^,,, > Sure, so we can create a DDL or what have you, but unless I'm missing something, I don't see a way to make a view that filters on doc.type or some other field, and then emits a simple set of values, which I think is required for a minimal view implementation. The idea of JSON pointers where we can just let users define path strings for the key and value is really intriguing, but missing functionality. -Russell