Test for existence of facet on edge

Hey @noandrea,

A trick for your use-case would be to do a regex matching for the date in the facets and return the nodes which doesn’t match. Or a simpler trick would be to use the gt() functionality on a zero date :slight_smile: . For example:

{
  q(func: has(spouse)) {
    uid
    spouse @facets(NOT gt(until, "0000-01-01T00:00:00Z")) {
      uid
    }
  }
}

The above query would return the only spouses with until < year 0000, which is equivalent to not having an until associated with the spouse. I am trying to think of other possible solutions but I guess this would help.

5 Likes