datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
2020-12-16T18:31:28.123500Z

hey there, trying to formulate a query and wondering how best to express it:

(d/q '[:find ?tuple
       :where [?tuple :tuple-ns/attr1+attr2+attr3 [tuple-attr-1 tuple-attr-2 tuple-attr-3]]]
     db)
I’m trying to query for a tuple that matches dynamic attrs. one attr could be an ident, though, and I can’t seem to formulate the query with the ident itself. e.g. in the query above, if tuple-attr-1 was an ident, I would need to query with the eid for the ident as opposed to the ident itself. is there any way around that?

favila 2020-12-16T18:42:53.123600Z

d/entid to normalize input to eids before issuing the query. if that’s not possible, consider writing a rule to do the same thing.