@mrchance that should work. I'm guessing the value you're looking for isn't the symbol foo
, but rather what the value foo
is bound to? Trying removing the quote before the vector.
Is :unique/name
set to unique in the schema?
(-> db :schema :unique/name)
;; should contain :db/unique with either
;; :db.unique/identity or :db.unique/value
I think you also can use (d/entid db [:unique/name foo])
to get the id directly
@petterik thanks, I'll try that. I only need the id, and yes, it's unique in the schema