Closed knotseaborg closed 1 year ago
This is definitely a bug in the type constraint definition, thanks a lot for the report, a fix is on its way!
No problem! Glad I could help.
The fix is going to be released towards the end of the month, with v5.9.0 FYI.
@knotseaborg 5.9.0 is now out with this fix: https://github.com/neo4j/neo4j-go-driver/wiki/5.x-changelog#v590
Thanks for the update!
The following error was found while retrieving a datetime value from the database
panic: expected value to have type dbtype.Time but found type time.Time
Neo4j Version: 5.7.0 Community Neo4j Mode: Single instance Driver version: Go driver v5.8.1 Go version: go1.20.4 linux/amd64 Operating System: Linux Mint 21.1 Vera 64-bit
Steps to reproduce
create (n:Node{dateTimeLabel: datetime("2016-11-22T18:59:00.000+0900")});
As an alternative, when
neo4j.Time
is replaced withtime.Time
, it does not match the type specification and an error is returned.Expected behavior
Perhaps the node property
dateTimeLabel
should be of typedbtype.Time
to avoid returning the error?Actual behavior
Node property
dateTimeLabel
is of typetime.Time
Stacktrace
For
goroutine 1 [running]: main.main() /home/--------- exit status 2
dateTimeVal, err := neo4j.GetPropertytime.Time if err != nil { //Non-nil error panic(err) }
./neo4j.go:131:38: time.Time does not satisfy neo4j.PropertyValue (time.Time missing in bool | int64 | float64 | string | github.com/neo4j/neo4j-go-driver/v5/neo4j/dbtype.Point2D | github.com/neo4j/neo4j-go-driver/v5/neo4j/dbtype.Point3D | github.com/neo4j/neo4j-go-driver/v5/neo4j/dbtype.Date | github.com/neo4j/neo4j-go-driver/v5/neo4j/dbtype.LocalTime | github.com/neo4j/neo4j-go-driver/v5/neo4j/dbtype.LocalDateTime | github.com/neo4j/neo4j-go-driver/v5/neo4j/dbtype.Time | github.com/neo4j/neo4j-go-driver/v5/neo4j/dbtype.Duration | []byte | []any