Perform queries with results indicated
Peer.q("[:find ?value :in $ :where [_ :db/doc ?value]]",tx.get(Connection.TX_DATA)); //returns []Peer.q("[:find ?value :in $ :where [_ :db/doc ?value]]",db); //returns valuesPeer.q("[:find ?value :in $ :where [_ 61 ?value]]",tx.get(Connection.TX_DATA)); //returns valuesPeer.q("[:find ?value :in $ :where [_ 61 ?value]]",db); //returns values
So :db/doc is mapped to 61 for a query against the database but not when referencing the txReport.
This initially looks rather strange but is a direct consequence of how Datomic is implemented.
:db/doc is merely an entity stored in the database, just like any other entity. It is not a special constant, baked into the implementation.
The txReport value does not contain the entity and thus cannot perform the mapping to attribute id.
Set up the test
uri = "datomic:mem://hello";Peer.createDatabase(uri);datom = Util.list("db/add",Peer.tempid("db.part/user"),"db/doc","hello world");queue = conn.txReportQueue();conn.transact(Util.list(datom));db = conn.db();tx=queue.poll();