Skip to content

:lookup

The :lookup operation is used for queries against indexes, when you need to be explicit.

One thing to know about :lookup is you cannot mat it, it is fairly unique in that regard.

(def CustomerByName [[:from :Customer] [:hash :firstname]])
(def db (rel/mat {} CustomerByName))
(def db (rel/transact {} [:insert :Customer {:firstname "bob"}]))
(rel/q db [[:lookup CustomerByName "bob"]]) 
;; =>
({:firstname "bob"})