This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-30
Channels
- # adventofcode (3)
- # announcements (4)
- # babashka (42)
- # beginners (56)
- # biff (23)
- # cider (8)
- # clj-yaml (2)
- # cljdoc (16)
- # clojure (83)
- # clojure-europe (52)
- # clojure-nl (3)
- # clojure-norway (4)
- # clojure-sweden (2)
- # clojure-uk (2)
- # clojurebridge (1)
- # clojurescript (2)
- # cloverage (1)
- # cursive (11)
- # data-oriented-programming (1)
- # deps-new (2)
- # dev-tooling (2)
- # emacs (3)
- # etaoin (4)
- # events (5)
- # fulcro (5)
- # gratitude (3)
- # java (3)
- # jobs (1)
- # jobs-discuss (1)
- # joyride (33)
- # malli (16)
- # music (1)
- # nbb (1)
- # nrepl (4)
- # nyc (1)
- # off-topic (25)
- # pathom (8)
- # re-frame (1)
- # reitit (7)
- # remote-jobs (2)
- # shadow-cljs (6)
- # tools-deps (9)
Is it possible to do a pull on an ident? Can't seem to find the right syntax.
By 'ident' do you mean an attribute-value pair? (XT doesn't have idents like Datomic does). If so you'll have to use q
directly, Biff doesn't have a helper for it.
Maybe I should update biff/lookup
so that if there's an even number of args, it treats the second one as a pull expression. so you could call it like (biff/lookup db '[* {:foo/bar [*]}] :baz "quux")
That's exactly what I want!!!
Here ya go 🙂 (haven't tested it yet)
(defn lookup [db & args]
(let [[pull-expr & kvs] (if (odd? (count args))
args
(conj args '[*]))]
(ffirst (xt/q db {:find [(list 'pull 'doc pull-expr)]
:where (vec
(for [[k v] (partition 2 kvs)]
['doc k v]))}))))
I'll throw this into the next biff release; in the mean time you can copy it into your project somewhere.Nice!!
I didn’t know about biff/lookup
… nice!
I need to actually read all the biff source soon.
I think that one is in the official docs
haha… I’m busted!
Heh. I forgot most of what I read in the docs. Trying to read twice.
that's a link to the old docs FYI, new ones are here: https://biffweb.com/docs/api/xtdb/
But I just memorized them all!!
(is there a link to that somewhere on the website or did you have it bookmarked or something?)
lemme figure out how I got there…
:) fortunately the concerns are mostly all the same
*contents
I had googled site:
ah, that would do it
You will need to hand write a letter to Google.
I can't hide my old files from them
the EU is about to pass the Right For Old Docs To Be Forgotten bill, so no worries.