0

如果属性在特定集合(或列表)中,我想在数据日志中的 where 子句中进行测试。例如我想测试是否:tag-type/code["urgent" "todo"]. 我可以做这个:

   (or
       [?tag-type :tag-type/code "urgent"]
       [?tag-type :tag-type/code "todo"]
        )

但我想成为一个参数列表。说?tag-names 所以,我想做一些这样的事情:

       [?tag-type :tag-type/code *in* [?tag-names])]

那可能吗 ?

4

1 回答 1

1

一个朋友 - 没有 SO 帐户!- 帮助了我。您可以像这样在 :in-clause 中指定一个集合:

[?collection-name  ...]

产生:

(d/q '[:find (pull ?tag-type "[*]")
       :in $ [?tag-names ...] 
       :where 
       [?tag-type :tag-type/code ?tag-names]] 
        the-db ["urgent" "todo"])
于 2016-02-06T12:06:25.430 回答