cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

Using property values in toBoolean vs. typed in text

dnacy
Node

I'm trying to use a property (k.rule) that holds an expression to be evaluated as true/false. When I pass it into the function toBoolean, I get a null result. If I type it directly into the function, I get the expected result.

match (Size:Question {name: "Size"}),(height_adjustment:Question {name: "Height Adjustment"}),( question {name: "Height Adjustment"})-[k:HAS_OPTION]-(options) return question.name,options.name,Size.answer,k.rule,toBoolean(Size.answer = "a size"),toBoolean(k.rule)

I want toBooolean(k.rule) to evaluate the same as the typed in value toBoolean(Size.answer = "a size").

Any hints are appreciated.

1 REPLY 1

that doesn't work with toBoolean() you can probably use the function apoc.cypher.runFistColumn("return "+k.rule, {... params ..})