Fork me on GitHub
#datomic
<
2020-04-08
>
denik16:04:39

Is there a way to pass collections to :in and achieve logical and matching instead or as in collection bindings? https://docs.datomic.com/on-prem/query.html#collection-binding

favila16:04:26

what do you mean by “and matching”?

denik16:04:20

[:in $ [?match-all-these ...]
 :where
 [?foo :foo/attrs ?match-all-these]]

denik16:04:29

so that of the collection passed in, the query engine only returns the entities who's attribute contain all of the collection's values

denik16:04:46

that is, for cardinality/many

favila16:04:48

No. there’s only one item bound at a time, so it only unifies on one at a time. to bind “all the attr values matching [?foo :foo/attrs]`” to a single thing requires some kind of aggregation.

favila16:04:05

there are a few approaches to this. The easiest IMO is just to use some clojure code

denik16:04:15

thanks @U09R86PA4 for using the internet which I failed to do 😄

favila16:04:17

sorry, wrong one