Fork me on GitHub
#datascript
<
2018-04-25
>
misha09:04:16

Probably to match clojure.core/comp, which composes fns right to left, @rnagpal

rnagpal13:04:32

what is the best way of having unique ids for IDs (:db/id) I tried using string(UUID -> str) and it doesn’t seem to work. t/now -> to-long works

rnagpal14:04:31

or use nano-time ?

rnagpal14:04:42

(defn nano-time []
  #?(:clj (System/nanoTime)
     :cljs (js/performance.now)))

souenzzo14:04:39

try with (new js/Date)

rnagpal14:04:41

Another question 🙂 This query is not working

(defn find-before-time [end]
  (let [query '[:find [(pull ?e [*]) ...]
                :where
                [?e :timestamp ?time]
                [(< ?time)]]]
    (d/q query @conn end)))

souenzzo14:04:25

(defn find-before-time 
  [end]
  (let [query '[:find [(pull ?e [*]) ...]
                :in $ ?end
                :where
                [?e :timestamp ?time]
                [(< ?end ?time)]]]
    (d/q query @conn end)))

✔️ 4