Catmandu icon indicating copy to clipboard operation
Catmandu copied to clipboard

Field selection with recursive path operator "..."

Open nichtich opened this issue 11 years ago • 5 comments

How about a path operator ... that selects of fields and subfields?:

# { foo => "  x ", bar => { foo = "  y "} }
trim("...foo") # { foo => "x", bar => { foo = "y"} }

nichtich avatar Sep 19 '13 09:09 nichtich

What about Data::Seek as a general solution for traversing complex hashes

vpeil avatar Apr 01 '15 07:04 vpeil

This feature (and much more) will be available in the next release of Catmandu with the visitor() bind:

do visitor()
    if all_match(key,foo)
        trim(scalar)
    end
end

https://github.com/LibreCat/Catmandu/blob/dev/lib/Catmandu/Fix/Bind/visitor.pm

phochste avatar May 22 '15 14:05 phochste

this one can be closed, I suppose? The magic visitor bind has been released.

vpeil avatar Jul 13 '15 14:07 vpeil

Visitor is one route. @nics is working on a new Fix path algorithm that can do the requests shorthand in a future release of Catmandu

phochste avatar Jul 13 '15 14:07 phochste

See #56 first.

nichtich avatar Dec 11 '15 13:12 nichtich