I have a Datascript db that's like this:
{:block/id {:db/unique :db.unique/identity}
:block/children {:db/cardinality :db.cardinality/many}
}
:block/children
contains :block/id
of other blocks
I've been trying to write a query to find which block has another block as its child.
Here's an example of what I've tried:
(ds/q '[:find ?parent-ds-id
:where
[1100 :block/id ?block-id]
[?parent-ds-id :block/children ?block-id]]
@conn)
I just get the empty set back in return. How am I supposed to dress up ?block-id
so that I get back the entity ID of the block who has ?block-id
as one of its children? (Every block only ever has one parent)