This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-18
Channels
- # announcements (12)
- # babashka (6)
- # beginners (62)
- # calva (3)
- # cider (41)
- # clerk (5)
- # clojure (192)
- # clojure-bay-area (1)
- # clojure-europe (14)
- # clojure-norway (97)
- # clojure-uk (6)
- # clojuredesign-podcast (4)
- # clojurescript (30)
- # code-reviews (7)
- # cursive (32)
- # datahike (4)
- # datomic (35)
- # docker (8)
- # emacs (8)
- # events (1)
- # fulcro (13)
- # helix (19)
- # hoplon (4)
- # hyperfiddle (37)
- # jobs-discuss (10)
- # membrane (11)
- # missionary (19)
- # off-topic (28)
- # polylith (8)
- # portal (10)
- # practicalli (8)
- # re-frame (31)
- # reitit (6)
- # shadow-cljs (39)
- # timbre (3)
- # vim (1)
- # xtdb (6)
Hello. Can I compute a new value on xt/q ?
I want to return with the tuple a new value score
that isn't stored in the DB, but is determined based on timestamp, upvotes, and current time...
I was able to figure it out,
(sort-by #(/ (get % :item/upvotes) (Math/pow (+ (/ (- (System/currentTimeMillis) (get % :item/minted-at)) 3600) 2) 1.5)) >) ;;score
turns out the System/currentTimeMillis was the issue in Electricland xD 😃
🎉 1
Hi! I really like the changes proposed in 2.0 - are there any examples out there, other than the ones in the docs?
Hey @UKDLTFSE4 thanks for the feedback! There are lots of tests in the 2.x branch you can study e.g. https://github.com/xtdb/xtdb/blob/2.x/src/test/clojure/xtdb/sql_test.clj and https://github.com/xtdb/xtdb/blob/2.x/src/test/clojure/xtdb/datalog_test.clj