Just got started with datascript queries. I see that we can use predicates.
predicates can compare a property
with the provided value
But I have a predicate, which takes an entity. How can I pass entity to the predicate?
I have
(defn event-matches-1 [event start-time end-time categories levels]
... )
[:find ?e
:in $ ?start ?end ?categories ?levels
:where
[(user/event-matches-1 ?e ?start ?end ?categories ?levels)]]
in the function/predicate event-matches-1
I get event as nilhaven't done much datascript lately but looks like ?e
is not bound to anything in the query?
for example...
:where
[?e :my/name ?name]
[(user/event-matches-1 ?e ?start ?end ?categories ?levels)]]