Fork me on GitHub
#datomic
<
2021-06-28
>
Aleh Atsman12:06:34

Hey, what's the best way to construct query that returns all items with specified ids. Given I have list of ids, let's say list of user/id, how do I get all entities corresponding to these ids?

🆘 3
🤯 3
🙏 3
RollACaster13:06:34

I’m not sure if it’s the best way to go since I’m new to Datomic, but that’s how I would do it:

(d/q
 '[:find ?e
   :in $ [?id ...]
   :where
   [?e :user/id ?id]]
 db
 ["id-1" "id-2"])

❤️ 3
Aleh Atsman15:06:17

@UB5T2688Y thanks! that's exactly what I was looking for!