使用限制/默认值在查询中拉取表达式?



如何在查询中使用 at pull 表达式中的限制/默认值?给定一个基数多属性,我如何控制返回多少个值(默认值为最多 1000 个值!

(发现很难从文档/示例中找出正确的语法(

限制(对于基数-多属性(

返回最多 2 个基数-多属性:ns/ints值:

[:find  (pull ?a [(limit :ns/ints 2)])
:where [?a :ns/str ?b]]

返回基数-多属性:ns/ints的所有值:

[:find  (pull ?a [(limit :ns/ints nil)])
:where [?a :ns/str ?b]]

违约

如果属性:ns/ints没有值,则2000返回默认值:

[:find  (pull ?a [(default :ns/ints 2000)])
:where [?a :ns/str ?b]]

如果基数多属性:ns/ints没有值,则返回默认值20002001

[:find  (pull ?a [(default :ns/ints [2000 2001])])
:where [?a :ns/str ?b]]

最新更新