datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
rnagpal 2018-04-30T20:03:21.000605Z

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 nil

javi 2018-04-30T22:08:34.000052Z

haven'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)]]

1👍