This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-17
Channels
- # announcements (13)
- # beginners (56)
- # brompton (1)
- # cider (2)
- # cljsrn (10)
- # clojure (369)
- # clojure-australia (4)
- # clojure-boston (1)
- # clojure-europe (28)
- # clojure-nl (1)
- # clojure-spec (1)
- # clojure-uk (18)
- # clojurescript (26)
- # data-science (2)
- # datahike (4)
- # datalog (2)
- # datasplash (6)
- # datomic (9)
- # events (1)
- # kaocha (4)
- # macro (1)
- # malli (22)
- # meander (40)
- # membrane (30)
- # music (1)
- # nbb (3)
- # news-and-articles (3)
- # off-topic (12)
- # practicalli (1)
- # re-frame (19)
- # remote-jobs (1)
- # sci (22)
- # shadow-cljs (15)
- # spacemacs (4)
- # tools-deps (40)
- # xtdb (26)
#datasplash2021-08-17
I have a change in my forked version of the lib. It's for datastore, when creating entities.
(defn- make-ds-entity-builder
[raw-values {:keys [exclude-from-index] :as options}]
(let [excluded-set (into #{} (map name exclude-from-index))
^Entity$Builder entity-builder (Entity/newBuilder)]
(doseq [[v-key v-val] raw-values]
(.put (.getMutableProperties entity-builder)
(if (keyword? v-key) (name v-key) v-key)
(let [^Value$Builder val-builder (make-ds-value-builder v-val)]
(-> val-builder
(cond->
(or (excluded-set (name v-key))
(and (string? v-val) (> (alength (.getBytes v-val)) 1500)))
(.setExcludeFromIndexes true))
(.build)))))
entity-builder))
Currently you can pass in a set of fields to be excluded from indexes, but this only works for top level entities.