Alan Thompson
2017-03-20 14:42:42 UTC
I have noticed that Datomic uses two different keywords to denote the EID
for an entity in the DB. It sometimes uses `:e` and other times uses
`:db/id`:
Results of a transaction:
tx-datoms =>
[ {:e 13194139534333, :a :db/txInstant, :v #inst
"2017-03-20T13:39:05.607-00:00", :tx 13194139534333, :added true}
{:e 17592186045438, :a :person/name, :v "Sylvia Trench", :tx
13194139534333, :added true}
{:e 17592186045439, :a :person/name, :v "Tatiana Romanova", :tx
13194139534333, :added true}
{:e 17592186045440, :a :person/name, :v "Honey Rider", :tx
13194139534333, :added true}
{:e 17592186045441, :a :person/name, :v "Bibi Dahl", :tx
13194139534333, :added true}
{:e 17592186045442, :a :person/name, :v "Octopussy", :tx
13194139534333, :added true}
{:e 17592186045443, :a :person/name, :v "Paris Carver", :tx
13194139534333, :added true}
{:e 17592186045444, :a :person/name, :v "Christmas Jones", :tx
13194139534333, :added true} ]
Results of a `pull` query:
(d/pull (live-db) [:bond-girl] [:person/name "James Bond"]) =>
{:bond-girl [
{:db/id 17592186045438}
{:db/id 17592186045439}
{:db/id 17592186045440}
{:db/id 17592186045441}
{:db/id 17592186045442}
{:db/id 17592186045443}
{:db/id 17592186045444}
{:db/id 299067162756090} ] }
The problem is the basic #datom type:
#datom[13194139534333 50 #inst "2017-03-20T14:35:48.147-00:00"
13194139534333 true]
which can only be accessed by code such as this:
; build a clojure map from the datom
{:e (:e datom)
:a (long (:a datom)) ; must cast Integer -> Long
:v (:v datom)
:tx (:tx datom)
:added (:added datom)}
This threw me off for a bit when I first saw it, and I was wondering if
there might be a way of unifying the terminology in the future.
Alan
for an entity in the DB. It sometimes uses `:e` and other times uses
`:db/id`:
Results of a transaction:
tx-datoms =>
[ {:e 13194139534333, :a :db/txInstant, :v #inst
"2017-03-20T13:39:05.607-00:00", :tx 13194139534333, :added true}
{:e 17592186045438, :a :person/name, :v "Sylvia Trench", :tx
13194139534333, :added true}
{:e 17592186045439, :a :person/name, :v "Tatiana Romanova", :tx
13194139534333, :added true}
{:e 17592186045440, :a :person/name, :v "Honey Rider", :tx
13194139534333, :added true}
{:e 17592186045441, :a :person/name, :v "Bibi Dahl", :tx
13194139534333, :added true}
{:e 17592186045442, :a :person/name, :v "Octopussy", :tx
13194139534333, :added true}
{:e 17592186045443, :a :person/name, :v "Paris Carver", :tx
13194139534333, :added true}
{:e 17592186045444, :a :person/name, :v "Christmas Jones", :tx
13194139534333, :added true} ]
Results of a `pull` query:
(d/pull (live-db) [:bond-girl] [:person/name "James Bond"]) =>
{:bond-girl [
{:db/id 17592186045438}
{:db/id 17592186045439}
{:db/id 17592186045440}
{:db/id 17592186045441}
{:db/id 17592186045442}
{:db/id 17592186045443}
{:db/id 17592186045444}
{:db/id 299067162756090} ] }
The problem is the basic #datom type:
#datom[13194139534333 50 #inst "2017-03-20T14:35:48.147-00:00"
13194139534333 true]
which can only be accessed by code such as this:
; build a clojure map from the datom
{:e (:e datom)
:a (long (:a datom)) ; must cast Integer -> Long
:v (:v datom)
:tx (:tx datom)
:added (:added datom)}
This threw me off for a bit when I first saw it, and I was wondering if
there might be a way of unifying the terminology in the future.
Alan
--
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datomic+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datomic+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.