Can I specify a unique reverse relation like this?
[{:dom/client-id #:db{:cardinality :db.cardinality/one,
:valueType :db.type/ref,
:unique :db.unique/identity}
{:dom/_attr+key #:db{:cardinality :db.cardinality/one,
:valueType :db.type/tuple,
:tupleAttrs [:dom/_attr :dom/attr-key],
:unique :db.unique/identity}}
if I am providing data like this?
{:dom/client-id "9fadb8a6-dfdc-40a7-84b0-9f2eef552345"
:dom/attr #:dom-attr{:key "client-id",
:value "9fadb8a6-dfdc-40a7-84b0-9f2eef552345"}}No, you can’t use leading underscore in schema at all
Thanks for the confirmation! I did end up creating a :dom/attr-parent to handle this and it seems to be working. I'm glad to understand why my previous schema wasn't working 🙂
My first example may not have been the best as client-id appears in two spots. Here is an example of storing an h1 tag in the db
[{:dom/type "heading",
:client/id "9cc3dd5f-0242-4ff6-9869-5e6dc28e5831",
:dom/attr #:dom-attr{:key "level", :value 1}}]