[4.2] Adding hasNot and whereHasNot method

See #3413