use the property path to check for equality when a value path is given i...

...nstead of comparing for object identiy

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #8825
| License       | MIT
| Doc PR        |