Testing attribute against list in datomic datalog -
i test in clause in datalog if attribute in particular set (or list). example want test whether :tag-type/code
in ["urgent" "todo"]
. can this:
(or [?tag-type :tag-type/code "urgent"] [?tag-type :tag-type/code "todo"] )
but list parameter. ?tag-names
, in lines of :
[?tag-type :tag-type/code *in* [?tag-names])]
is possible ?
a friend - without account! - has helped me out. can specify collection in :in-clause :
[?collection-name ...]
yielding :
(d/q '[:find (pull ?tag-type "[*]") :in $ [?tag-names ...] :where [?tag-type :tag-type/code ?tag-names]] the-db ["urgent" "todo"])
Comments
Post a Comment