The NOT doesn't work for regexp in filter

You would never have this result using regex. Because all other emails have ‘Address’. Soon they will be excluded as well.

You can try like this:

{
#I'm not saying you have to use hass. Just an example.
  A as q(func: has(email)){ 
    email
  }
  
  RS as result(func: uid(A)) @filter(regexp(email, /Address/)){
  email
 }
  
  result2(func: uid(A)) @filter(NOT uid(RS)){
    email
 }

}

Result

{
  "data": {
    "q": [
      {
        "email": "testaddress3@gmail.com"
      },
      {
        "email": "testAddress1@gmail.com"
      },
      {
        "email": "testAddress2@gmail.com"
      }
    ],
    "result": [
      {
        "email": "testAddress1@gmail.com"
      },
      {
        "email": "testAddress2@gmail.com"
      }
    ],
    "result2": [
      {
        "email": "testaddress3@gmail.com"
      }
    ]
  }
}
1 Like