This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-17
Channels
- # aws-lambda (1)
- # beginners (55)
- # cider (19)
- # clojure (96)
- # clojure-spec (2)
- # clojure-uk (6)
- # clojurescript (22)
- # datomic (6)
- # editors (13)
- # emacs (6)
- # euroclojure (1)
- # hoplon (3)
- # immutant (1)
- # jobs-rus (2)
- # off-topic (2)
- # onyx (4)
- # portkey (3)
- # re-frame (76)
- # reagent (110)
- # shadow-cljs (13)
- # spacemacs (10)
- # specter (9)
- # tools-deps (9)
- # vim (7)
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 [["" "sport" "sport"]
["" "messages"]]}
{
:name "News"
:rules [["" "sport"]
["" "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!