om-next

linuss 2017-01-26T09:33:39.000880Z

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

linuss 2017-01-26T09:35:04.000881Z

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>)

linuss 2017-01-26T09:35:41.000882Z

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

sova-soars-the-sora 2017-01-26T22:20:16.000889Z

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

sova-soars-the-sora 2017-01-26T22:20:54.000890Z

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...