我有以下結構過濾圖的其他集合與UUID
(def my-coll '{:data (
{:book/public-id #uuid "555b6f35-4e8c-42c5-bb80-b4d9147394c0", :book/name "AAA"}
{:book/public-id #uuid "555b6f35-4e8c-42c5-bb80-b4d9147394c1", :book/name "BBB"}
{:book/public-id #uuid "555b6f35-4e8c-42c5-bb80-b4d9147394c3", :book/name "CCC"}
)})
,我想通過
(def filter-coll '(#uuid "555b6f35-4e8c-42c5-bb80-b4d9147394c1" #uuid "555b6f35-4e8c-42c5-bb80-b4d9147394c2"))
我想離開只是從集合ID進入,例如用於過濾獲得通過UUID這種方式單一值
{:data (
{:book/public-id #uuid "555b6f35-4e8c-42c5-bb80-b4d9147394c0", :book/name "AAA"}
{:book/public-id #uuid "555b6f35-4e8c-42c5-bb80-b4d9147394c3", :book/name "CCC"}
)}
我過濾沒有問題:
(prn {:data (filter #(= (:book/public-id %) #uuid "555b6f35-4e8c-42c5-bb80-b4d9147394c0") (my-coll :data))})
其中我 - 科爾是我的輸入結構。 但當我嘗試通過過濾收集
(prn {:data (filter #(contains? (:book/public-id %) filter-coll) (my-coll :data))})
我有錯誤
contains? not supported on type: java.util.UUID
什麼辦法,我可以通過收集UUID過濾輸入結構?