Learning Datomic, and having trouble with a basic case. Given a simple schema containing:
:club/name
:club/members (ref, cardinality many)
and
:people/name
So it might be populated (basically) like this:
[
{:club/name "Carpentry" :club/members [:person/name "liliana" :person/name "alexei"}]}
{:club/name "Taxidermy" :club/members [:person/name "karenna" :person/name "alexei"}]}
etc.
]
I want to do a reverse navigation to find "all the clubs 'alexei' is in". If I do this, I get only one club:
d/q '[:find (pull ?g [ {:club/_members [:club/name]}])
:in $
:where
[?g :person/name "alexei"]
]
(d/db conn))
I would expect to get two hits for this example data. Am I modeling it backwards? Do I have to create a separate entity to express person-in-club?
Thanks much!