This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-26
Channels
- # announcements (1)
- # autochrome-github (1)
- # babashka (9)
- # beginners (112)
- # bristol-clojurians (2)
- # calva (26)
- # cider (10)
- # clj-kondo (31)
- # cljs-dev (40)
- # clojure (114)
- # clojure-austin (1)
- # clojure-dev (112)
- # clojure-europe (22)
- # clojure-germany (5)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-norway (1)
- # clojure-spec (10)
- # clojure-uk (96)
- # clojurescript (39)
- # core-logic (5)
- # datomic (40)
- # fulcro (34)
- # graphql (17)
- # jobs (3)
- # kaocha (4)
- # leiningen (10)
- # luminus (1)
- # malli (3)
- # meander (44)
- # midje (2)
- # off-topic (40)
- # pathom (5)
- # re-frame (8)
- # reitit (8)
- # ring (3)
- # ring-swagger (4)
- # shadow-cljs (83)
- # spacemacs (96)
- # tools-deps (16)
- # vim (4)
- # xtdb (15)
- # yada (20)
(defn get-brio-nr
[db cust]
(println "cust on db " cust)
(get-in db [::ogm-search-results cust :brio-nr]))
I have a customer and i would like to get the :brio-nr of the same customer that i passed as paramenter into the get-in. I'm getting a null instead and i have no idea of how to make this workI think the problem might be with ::, which is the notation I find very confusing and do not use it. It adds the current namespace in front of the keyword. So maybe the data have a different namespace than the one in which this is called.
In general, if you have a similar problem, I would debug all steps of this path in the data:
(js/console.log cust db (get-in db [::ogm-search-results]) (get-in db [::ogm-search-results cust]) (get-in db [::ogm-search-results cust :brio-nr]))
Then you can see easily where is the problem.
Thank you!! Let me check that
Does someone could please give a insight?
@ramonp.rios we can't really give you any more insights without seeing the data you're passing in (the value of cust
and db
). All I can tell you is that there is some mismatch between your code and the actual structure of the data.