apoc.util.validatePredicate
Function APOC Core
apoc.util.validatePredicate(predicate, message, params) | if the predicate yields to true raise an exception else returns true, for use inside WHERE subclauses
Signature
apoc.util.validatePredicate(predicate :: BOOLEAN?, message :: STRING?, params :: LIST? OF ANY?) :: (BOOLEAN?)
Input parameters
Name | Type | Default |
---|---|---|
predicate |
BOOLEAN? |
null |
message |
STRING? |
null |
params |
LIST? OF ANY? |
null |
Usage Examples
The following throws an exception because the predicate is true:
MATCH (a)
WHERE apoc.util.validatePredicate(true,'message %d',[42])
RETURN a
Failed to invoke procedure |
The following returns true because the predicate is false:
RETURN apoc.util.validatePredicate(false,'message %d',[42]) AS result
result |
---|
true |