Find entities that not have a value in properties

26 views Asked by At

Think about this problem, I have a database with people and his friends:

['Bart" :person/friend "Milhouse"]
['Bart" :person/friend "Homer"]
['Homer" :person/friend "Marge"]
...

In this database I want to get all the people that are NOT friend of Milhouse, if I try to do somehting like this:

(d/q '[:find ?person
       :where
       (not 
        [?p :person/friend ?f]
        [?f :person/name "Milhouse"])]
     db)

I will get a list of all the people that have at least one friend whose name is not Milhouse.

How can I archive this?

the query above is what I tried

0

There are 0 answers