if you’re using classpath functions, can you say if you’re updating them with 1) 🔌 transactor restart or 2) clojure-spin using the repl? Please comment on how you’re doing it an if it’s working well for you.
Hi! I have a newbie question. This is the basic query I wrote:
(d/q '[:find ?u
:in $ ?useremail
:where
[?u :user/email ?email]
[?u :user/name ?uname]
[(my.utils/fuzzy-match ?uname ?useremail)]]
db "Alice")
I would like to change it so that Datomic returns all users with an email that either match whatever my.utils/fuzzy-match returns OR don't actually have a :user/name attribute.I ended up with something like this
(d/q '[:find [?u ...]
:in $ ?useremail
:where
[?u :user/email]
(or-join [?u ?useremail]
(and [?u :user/email ?email]
[(my.utils/fuzzy-match ?email ?useremail)])
(and [?u :user/name ?uname]
[(my.utils/fuzzy-match ?uname ?useremail)]))]
db "Alice")
Which seems to work for my use caseThis seems different from what you asked for? This applies fuzzymatch to username and email, includes ?u if either one matches.
Yep, in the initial question I simplified it a bit
"OR don't actually have a :user/name attribute." is not what you actually want?
It's not. I got confused because all my users have an email but the name is optional