Fork me on GitHub
#om-next
<
2017-01-26
>
linuss09:01:39

Hey guys, I'm trying to achieve something, but I can't seem to get it right. I'm writing a small application to store and edit forms using Om.Next and DatasScript. I'm running DataScript in the backend to store the forms. In the front-end, I'd like to display a list of form id's, and when one is clicked/selected, the corresponding form. My problem is that I can't seem to query both all form ID's and all the data from a single form using the same pull syntax

linuss09:01:04

To get all the id's, I have to do something like (d/q '[:find ?e :where [?e :form/id]) (d/db conn)), while to get all the fields from a single form, I have to do something like (d/pull (d/db conn) '[*] <eid>)

linuss09:01:41

ho, sorry, the first query should be (d/q '[:find ?id :where [_ :form/id ?id])

sova-soars-the-sora22:01:16

@linuss so how are your form IDs an your form fields connected ? many form fields for a single form ID?

sova-soars-the-sora22:01:54

If I understand your question right, I think you are trying to achieve with a single query what may take 2 (getting all the form IDs, then getting the form fields for a given ID). On the other hand, if you are trying to grab them all at once...