【发布时间】:2015-03-05 01:40:07
【问题描述】:
假设我有一个具有多值属性(例如数字)的 Datomic 实体。如何返回其值不包含特定数字的实体列表?
举个例子,
{:db/id #db/id [:db.part/db]
:db/ident :strs
:db/valueType :db.type/string
:db/cardinality :db.cardinality/many
db.install/_attribute :db.part/db
}
我想找到列表中不包含数字 1 的所有实体。
If I do something like:
[:find ?e :where
[?e :strs ?v]
(not [(.contains ?v "b")])
]
但我有
e1 :strs ["a", "b", "c"]
e2 :strs ["a", "b"]
e3 :strs ["h", "i", "j"]
然后返回所有实体,因为查询被解释为 "查找具有不包含 "b" 的 strs 成员的实体", 但我需要
"查找每个成员不包含"b"的实体e"。
谢谢!
【问题讨论】: