Fork me on GitHub
#datomic
<
2021-11-20
>
Benjamin17:11:21

Is it possible to assert and add entities to a lookup ref like this?

{:tx-data
    [[:db/add
      [:airstats.pipeline/id "bestid4"]
      :airstats.pipeline/jobs
      ;; assert new entities here
      [{:airstats.error/type "fo"}]
      ]]}
well something like this, I mean I want to add new "jobs" entities. This code throws
{:cognitect.anomalies/category :cognitect.anomalies/incorrect,
    :cognitect.anomalies/message
    "Invalid list form: [#:airstats.error{:type \"fo\"}]",
    :db/error :db.error/invalid-lookup-ref}

favila17:11:53

The value slot of db/add or retract cannot be a map

favila17:11:23

Emit multiple ops or use the map form

👍 1
Benjamin13:11:18

multiple ops = multiple transactions right?

Benjamin13:11:14

ah you meant multiple [:db/add ..] ?