Fork me on GitHub

I see datomic cloud accepts frequencies as an aggregate if :find but I don’t see it documented, is that supported or some undefined behaviour? EDIT: doesn’t seem to return what I’d expect… weird that it’s accepted


I think you are accidentally using it as a custom aggregate:


I think no-namespace symbols are interpreted as in clojure.core, so it happens to work


I haven’t seen anything in cloud docs about custom aggregates


because it’s cloud (query is running on a different process than yours) there’s usually stuff you need to do to expose your fn to the query code


but again, I think because it’s clojure core it just accidentally works


I can also use datomic.api functions in a client query when using peer-server


but it didn’t work… it’s not returning what frequencies should


what is it returning?


it didn’t get all the values I was expecting it to get… I’ll try it out again later if it should work


Perhaps I’m not understanding the cloud docs as they don’t mention the custom aggregates


This is what I get:


(dc/q '[:find (frequencies ?b)
         :with ?a
         :in $ [[?a ?b]]]
       db [[:a :A] [:a :Z] [:b :A] [:b :F]])
=> [[{:F 1, :A 2, :Z 1}]]


seems right?


that looks right


my frequencies is only getting one item so the result is always a mapping of {the-one-value 1}


but thanks for the help, I’ll continue investigating later


if you don’t use :with, that is expected


the result is a set, thus every item occurs once

jeff tang19:06:36

hi! is it possible to retract a reverse-loookup attribute-value? e.g. [:db/retract 100 :_children 200]


[:db/retract 200 :children 100]


it’s not possible with an underscore attribute

👍 3

you have to reverse the terms


Is it possible to respond to http ion requests with multiple "Set-Cookie" headers? My response using just ring wrap cookies looks like this:

"Headers": {
            "Content-Type": "application/transit+json; charset=utf-8",
            "Set-Cookie": [
This works in ring since for seqs the header is translated to this:
Content-Type: application/transit+json; charset=utf-8
Set-Cookie: jwt-token=eyJraWQiOiJOM0pRej--retracted--sdfw;Path=/;HttpOnly;SameSite=Strict
However the ion spec only allows maps of string->string to be returned, and there is no way to set multiple cookeis with only one line in the header.


Genius - thanks!


This fix works great on Ions with Solo deploy or via Lambda, but it’s failing for me with http-direct.

   :status 200
   :headers {
   :body "{\"data\": \"stuff\"}"
This response from the http-direct handler results in the HTTP response:
< HTTP/2 200
< content-type: application/json
< content-length: 264
< date: Sun, 28 Jun 2020 07:30:54 GMT
< x-amzn-requestid: c3bc8a56-c0bf-41d7-b6b3-24292a2b6509
< x-amzn-remapped-content-length: 264
< set-cookie: b=cookie
< x-amz-apigw-id: O1APLEtPIAMFkGw=
< x-amzn-remapped-server: Jetty(9.4.24.v20191120)
< x-amzn-remapped-date: Sun, 28 Jun 2020 07:30:53 GMT
< x-cache: Miss from cloudfront
… only a single ‘set-cookie’ header when received by the client.


I have also tried different variations of multiValueHeaders (which is supported by API Gateway) but the Ions HTTP direct wrapper seems to ignore those. Would love to hear if anyone else has seen this issue or worked around it (or if it really is a bug)!


I do not use or recommended this CaSE sensitive solution. I just join the cookies with ;


@U2J4FRT2T are you suggesting this?

:headers { "set-cookie": "a=cookie; b=cookie" }
I wasn’t able to find any documentation on combining multiple cookies in the same header but I tried it anyways and found that browsers ignore the 2nd cookie (`b=cookie` in this example).


That’s part of the browser spec. I tried that at first. A new line is required for every cookie. Maybe a \n is needed?


Thanks for the idea! I wasn’t able to get \n to work. I posted the header inconsistency (between :lambdas and :http-direct to the datomic forum). Hopefully someone from the Datomic team will comment.

👍 3
Pedro Silva20:06:13

Hello, I am executing the split stack process to be able to upgrade our Datomic version as described in: After start the delete process in CloudFormation we get an error as you can see in the image. Someone can help us to solve this problem and be able to continue the process? Thank you.


One year ago I deployed a datomic-ions stack After fail 3 times in row I decided to not try updates anymore. Im really sad to see that they still fail at updates

😐 3