Invalid call signature for DateTimeFunction: Provided input was [2021-05-05T06:17:58Z]

Using neo4j version 5.5.0-community, with a client app nodejs connected with version ^5.2.0 (neo4j-driver) we receive the following error message intermittently:

Invalid call signature for DateTimeFunction: Provided input was [2021-05-05T06:17:58Z]

If you call the datetime function with that exact input it does work correctly:

return datetime('2021-05-05T06:17:58Z')

Then we will run the query again, same query, and it will return the correct results. Run it several times and it may randomly throw that error again but for a different timestamp.

The timestamps are datetime in the database, and we use the datetime(input) function, however in this query we are using a combination of datetime and coalesce:

datetime(COALESCE(delivery.collectedTime, delivery.completedTime)).seconds

Any ideas on what this could be?

^ Bump

Any ideas on how to solve this issue? Have there been any defects in datetime parsing in the last few versions?

If your two properties delivery.collectedTime and delivery.completedTime are already datetime values in the database, you would not need the datetime function call.

You can use the coalesce method to chose the first non-null datetime value. The type of the value returned is that of the first non-null value.

Do you have a mixture of nodes were some have these properties as datetime values and some with these properties stored as string representation of a datetime value?

The error message states that you are passing a datetime value to the method datetime. It expects a string or a map, but not a datetime value.