Unable to use datetime functions when setting parameters in cypher-shell but the same works in neo4j browser.May 22, 2024Knowledge
Article DetailsDetailsHelp DetailsWhen attempting to use datetime function parameters in Neo4j versions 4.4.x versions prior to 4.4.19 and 5.x.x versions prior to 5.6.0, users may see a difference of behaviour between cypher execution in Neo4j Browser, compared with that using Cypher-Shell, due to a known issue. For example, the following query executes fine in Neo4j Browser, yet fails when issued in Cypher-Shell: @neo4j> :param dt2 => datetime.truncate('day', datetime({ timezone: 'America/Chicago' })); Builder state empty @neo4j> :param start => datetime.truncate('second', datetime()); Failed to evaluate expression datetime.truncate('second', datetime()) @neo4j> :param dt => datetime.truncate('day', datetime()); Failed to evaluate expression datetime.truncate('day', datetime()) The usage of the trailing semi-colon is the cause of this issue. If using Neo4j versions 5.4.x and 5.5.x, one can workaround this issue by removing the ending semi-colon from the parameter definition when executing via Cypher-Shell. For example: :param dt2 => datetime.truncate('day', datetime({ timezone: 'America/Chicago' })) This issue has been addressed in Neo4j versions 4.4.19+ and 5.6.0+ to ensure the ending semi-colon is correctly handled without the need of the workaround.InformationTitleUnable to use datetime functions when setting parameters in cypher-shell but the same works in neo4j browser.Article Created Date3/15/2024, 10:55 PMURL Name15295605028371-Unable-to-use-datetime-functions-when-setting-parameters-in-cypher-shell-but-the-same-works-in-the-browserLast Modified Date5/22/2024, 8:37 PM