Fork me on GitHub
#datomic
<
2020-01-17
>
m0smith18:01:22

We are seeing a message like Cache put-result-handler error: net.spy.memcached.internal.CheckedOperationTimeoutException: Operation timed out. - failing node: /10.213.1.121:11211 in the AWS CloudWatch logs for Datomic Cloud. Is it something to be concerned about?

Leonid Scott21:01:26

Hi, I’m trying to query on a list of id’s like so:

(d/q '[:find ?title
       :in $ ?eids <- A list of the form (#{:db/id <ID>} ...)
       :where
       [?title :message/text ?eids]]
       db msg-eids)
How do I go about doing this? Thanks in advance!

cjmurphy21:01:43

Just pass in a list of eids, not a list of maps.

Leonid Scott22:01:57

Okay, my list will look like this:

(<ID> ...)
Do I need to change anything in the in clause?

favila22:01:27

yes you will need to destructure

favila22:01:36

:in $ [?eid ...]

favila22:01:28

If you keep the map :in $ [?eid-map ...]

favila22:01:51

then [(:db/id ?eid-map) ?eid] at the top of your :where

favila22:01:08

(it’s better not to pass in a map though)

zalky23:01:00

Hi all, wondering why the datomic api sometimes returns sets (entity) and sometimes returns vectors (pull) for cardinality many values? AFAIK, there is no intrinsic order to cardinality many values, and i'm wondering why vectors are returned.

favila04:01:27

Pull cannot guarantee results are a set

favila04:01:24

[{:card-many-attr [:not-unique-attr]} for eg. You are going to get duplicate {:not-unique-attr someval} entries

favila04:01:05

D/entity however can guarantee that because each entry is a unique entity object (entity equality is by db-id+ connection)

👍 4
zalky05:01:09

@U09R86PA4, great explanation, thanks for your response!