Fork me on GitHub
#datascript
<
2018-07-01
>
petterik01:07:57

@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

petterik01:07:31

I think you also can use (d/entid db [:unique/name foo]) to get the id directly

mrchance07:07:37

@petterik thanks, I'll try that. I only need the id, and yes, it's unique in the schema