This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-21
Channels
- # bangalore-clj (1)
- # beginners (60)
- # boot (30)
- # cider (7)
- # cljs-dev (10)
- # cljsrn (2)
- # clojure (163)
- # clojure-conj (10)
- # clojure-france (1)
- # clojure-greece (2)
- # clojure-italy (7)
- # clojure-russia (41)
- # clojure-serbia (22)
- # clojure-spec (41)
- # clojure-uk (41)
- # clojurescript (178)
- # cursive (36)
- # datascript (1)
- # datomic (23)
- # dirac (38)
- # graphql (12)
- # hoplon (20)
- # immutant (32)
- # instaparse (3)
- # keechma (1)
- # lein-figwheel (18)
- # leiningen (8)
- # liberator (1)
- # luminus (30)
- # lumo (29)
- # off-topic (18)
- # om (17)
- # pedestal (7)
- # planck (37)
- # precept (1)
- # re-frame (67)
- # ring-swagger (2)
- # timbre (1)
- # untangled (8)
- # vim (2)
Hello folks. I have a question about aggregates. Datomic automatically groups by all non-aggregate find elements. Given :foo/name
and :foo/age
, how would you write a query to return the name and age of the oldest person in the store? [:find ?name (max ?age) :in $ :where [?x :foo/name ?name] [?x :foo/age ?age]]
isn't it, AIUI — that's the oldest age of each distinct name.
folks, I've run out of ideas for how to retract a specific value in a component attribute
is there a way to :db/retract
a specific value in a component? For example
;; I just want to remove "bar"
{:db/id 1234, :some/component ["foo" "bar"]}
I can get ahold of the entity at :db/id
of course, and transact on that, and it's easy to add values to that component, like
(d/transact conn [[:db/add 1234 :some/component "whatever"]])
but I'm totally stumped at what the magic incantation is to remove a particular value from :some/component
any ideas would be most appreciated
seems like I'm missing something basic here
Datascript or cardinality/many attr?
oh you were asking me? sorry
yeah a component with cardinality/many
which I guess I thought was what you called that ("component")
@favila: :with is equivalent to including the column without projection, and including ?x actually makes the problem worse: it now groups on both ?x and ?name
oh, huh, guess it was just (d/transact conn [[:db/retract 1234 :some/component "bar"]])
? I thought I tried that
but, anyways, sorry for the noise--thanks anyways!
maybe this will help someone else…
@shaneprince: late response, but I've found it to be a best practice to include :pedantic? :warn
in my project.clj and then ruthlessly exclude anything that gives me warnings until there are none (having been bitten by order-of-class-loading bugs in the past)
If we create user for our backend storage that has readonly permissions and connect with that user in the connection string, will that peer have readonly access, or will it just fall over and break?
@uwo you can do this. Peers don't write, so you an give them read only access to storage and all is well. We do this with Sql storage: peers get SELECT-only access, and transactor gets only SELECT INSERT UPDATE DELETE