【发布时间】:2019-08-19 10:52:01
【问题描述】:
如何将映射作为?input 传递给 Datomic 查询并解构映射以匹配事实?
当我运行以下查询时,我得到一个NullPointerException:
(d/q '[:find ?e
:where
:in $ ?input
[?e :amount ?amount]
[(:amount ?input) ?amount]]
(d/db conn)
{:amount 123.0M})
=> Syntax error (NullPointerException) compiling at ...
但是,将金额作为输入参数传递是有效的:
(d/q '[:find ?e
:where
:in $ ?amount
[?e :amount ?amount]
(d/db conn)
123.0M)
=> [[1234]]
【问题讨论】:
-
也许您只需要在 Datomic 之外进行解构,就像您的工作示例中一样