This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-14
Channels
- # announcements (7)
- # aws (1)
- # babashka (1)
- # beginners (19)
- # calva (9)
- # clj-commons (4)
- # clj-kondo (64)
- # clj-on-windows (27)
- # cljsrn (12)
- # clojure (127)
- # clojure-bay-area (3)
- # clojure-europe (25)
- # clojure-hungary (7)
- # clojure-nl (1)
- # clojure-norway (9)
- # clojure-spec (5)
- # clojure-survey (2)
- # clojure-uk (22)
- # community-development (5)
- # core-async (19)
- # cursive (29)
- # datascript (8)
- # events (1)
- # fulcro (2)
- # graalvm (3)
- # jobs (1)
- # lsp (155)
- # malli (18)
- # nbb (6)
- # off-topic (86)
- # pathom (2)
- # rdf (18)
- # re-frame (9)
- # releases (2)
- # scittle (24)
- # shadow-cljs (33)
- # xtdb (4)
Hi all, I have question about Pull syntax for a query; are we able to access values from an inner map in a document? As I don't think we can use the braces syntax because they specify a join.
For example, what doesn't work:
;; doc: {:xt/id :ivan :user/name "Ivan" :user/details {:user/image "https://.." :user/bio "....."}}
(xt/q
(xt/db node)
'{:find [(pull ?user [:user/name {:user/details [:user/image]}])]
:where [[?user :user/id ?uid]]})
I would like to get only the :user/name and :user/image values returnedHey @U03MWJ46V0Q - XT's pull will only work with the top-level document values (and joins across those). If you want to use a pull-like API to retrieve nested document values you might be able to combine XT with https://github.com/lilactown/pyramid (either within the XT query or outside, after the query returns)
✅ 1