apoc.util.validate
Procedure
apoc.util.validate(predicate BOOLEAN, message STRING, params LIST<ANY>)
- if the given predicate is true an exception is thrown.
Usage Examples
The following throws an exception because the predicate is true:
WITH true AS predicate
CALL apoc.util.validate(predicate,'message %d',[42])
RETURN count(*);
Failed to invoke procedure |
The following does nothing because the predicate is false:
WITH false AS predicate
CALL apoc.util.validate(predicate,'message %d',[42])
RETURN count(*);
count(*) |
---|
1 |