Eq function can't use with val()

Conditional upsert doesn’t support inequality on val. Just length. Change your query to:

upsert{
  query{
    v as var(func:uid(0xc352)) @filter(eq(password, "123456")) {
      password
    }
  }
  
  mutation @if(eq(len(v)) {
    set{
      <0xc352> <password> "222222" .
    }
  }
}

BTW, you should use password-type https://dgraph.io/docs/query-language/schema/#password-type

1 Like