Hello, am i able to use spectres navigation to define what im looking for but return a structure several layers up, say for example i have the following data
(def ctx [
{
:id "blah"
:name "News2"
:rules [["<http://bbc.co.uk/sport|bbc.co.uk/sport>" "sport" "sport"]
["<http://facebook.com|facebook.com>" "messages"]]}
{
:name "News"
:rules [["<http://bbc.co.uk|bbc.co.uk>" "sport"]
["<http://facebook.com|facebook.com>" "messages"]]}
{
:name "monitoring"
:rules [["new-relic"]
["stack driver"]]}])
And navigation :
(select-first [ALL :rules ALL ALL #(= % "stack driver")] ctx)
This will return the string “stack driver” is possible it returns its outer record
{
:name "monitoring"
:rules [["new-relic"]
["stack driver"]]}
Hi Nathan, are there any sample data sets to try select and transform
@luke.defeo use selected?
for that
(select-first [ALL (selected? :rules ALL ALL #(= % "stack driver"))] ctx)
@manas.marthi you can use anything
e.g. parse some html into a clojure data structure
or just make up small toy examples like in the documentation
@nathanmarz thanks a lot
@nathanmarz thank you!