Fork me on GitHub
#datomic
<
2016-08-23
>
jimmy10:08:37

hi guys, is there anyway we can output missing fact as nil in datomic query ? Thanks

hans11:08:36

@nxqd: Datomic has no concept of a "missing fact", so there is no direct way to include keys in entities that are not present with a value. You need to be aware that any entity can have any attribute attached. There are not "entity types" which would restrict the possible attributes to a certain set.

hans11:08:13

@nxqd: What this means is that Datomic can't do it for you, but you can certainly do it yourself in your data layer which sits between your application and datomic.

yonatanel12:08:29

@nxqd: I've used a similar query to this (not with nil in my case). Maybe it will work:

(or (and [(missing? $ ?entity :some/attribute)]
         [(identity nil) ?value])
    [?entity :some/attribute ?value])

ckarlsen13:08:23

I've always had the impression that the rest api service counts as a normal licensed peer - is this correct?

marshall13:08:53

@ckarlsen Yes, the REST API is a peer.

ckarlsen13:08:49

for some reason I can run 2 jvm peers + 1 rest service with a 2 peer license...

ckarlsen13:08:06

usually the third peer just throws an exception on connect

yonatanel14:08:50

Is it possible to use a lookup ref instead of entity id in :db.fn/cas? Or even better, a temporary id (negative) in the same transaction that asserts a :unique/identity attribute and the :db/id? Also, what if entity has two identity attributes in the same transaction, one matches and the other doesn't? Does it resolve entity ID by the first one in the transaction sequence?

jimmy23:08:31

@yonatanel cool, those seem to be what I need.