Fork me on GitHub
#datomic
<
2017-06-21
>
stijn19:06:17

is there a way to specify multiple cassandra hosts in the transactor properties?

rnewman19:06:48

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.

favila19:06:14

I think add :with ?x

favila19:06:28

or include ?x in the find

ddellacosta20:06:07

folks, I've run out of ideas for how to retract a specific value in a component attribute

ddellacosta20:06:50

is there a way to :db/retract a specific value in a component? For example

ddellacosta20:06:22

;; I just want to remove "bar"
{:db/id 1234, :some/component ["foo" "bar"]}

ddellacosta20:06:21

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"]])

ddellacosta20:06:42

but I'm totally stumped at what the magic incantation is to remove a particular value from :some/component

ddellacosta20:06:36

any ideas would be most appreciated

ddellacosta20:06:15

seems like I'm missing something basic here

danielstockton20:06:50

Datascript or cardinality/many attr?

ddellacosta20:06:15

oh you were asking me? sorry

ddellacosta20:06:25

yeah a component with cardinality/many

ddellacosta20:06:36

which I guess I thought was what you called that ("component")

rnewman20:06:30

@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

ddellacosta20:06:15

oh, huh, guess it was just (d/transact conn [[:db/retract 1234 :some/component "bar"]]) ? I thought I tried that

ddellacosta20:06:37

but, anyways, sorry for the noise--thanks anyways!

ddellacosta20:06:45

maybe this will help someone else…

timgilbert20:06:46

@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)

uwo20:06:09

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?

favila13:06:54

@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

favila13:06:54

@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