如何在查询的pull表达式中使用limit / default?给定一个cardinality-many属性,如何控制返回多少个值(默认为最大1000个值!)。
((很难从文档/示例中找出正确的语法)
限制(对于基数很多属性)
返回基数多属性:ns/ints
的最大2个值:
[: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]]
默认
如果属性2000
没有值,则返回默认值:ns/ints
:
[:find (pull ?a [(default :ns/ints 2000)])
:where [?a :ns/str ?b]]
如果许多基数2000
没有值,则返回默认值2001
和:ns/ints
:
[:find (pull ?a [(default :ns/ints [2000 2001])])
:where [?a :ns/str ?b]]