The problem is still present. I did however adopt most of my code to use the rdf format, for which I wrote my own custom json to rdf converter. I can check tomorrow if the problem is still present with the newest code.
The reason for the problem might be that the dgo package uses reflection to convert all date alike fields into a time struct. To avoid this problem, the package would need to take into account the schema definition of the respective field.
Yepp. The schema is defined upfront. Interestingly everything works as intended when I use the ratel admin interface to set a predicate.
The conversion only makes problems when passing a json to the dgo client. That’s why I assume that there is some json string to go time conversion happening that is converting the date string to a date time string.
@Issif@tikiatua I wrote the following test and it seems to work fine. Will you let me know what doesn’t work for you? This is on current master of both dgraph and dgo.
Result
$ go test -v -run TestJsonTestOfTime
[Decoder]: Using assembly version of decoder
=== RUN TestJsonTestOfTime
{"q":[{"name":"A","port":"8983-01-01"},{"name":"B","port":"8083-01-01"}]}
--- PASS: TestJsonTestOfTime (0.68s)
PASS
ok github.com/dgraph-io/dgraph/dgraph/cmd/alpha 0.701s
dgo v2.X is not compatible with dgraph v1.0.X
See the compatibility matrix here GitHub - dgraph-io/dgo: Official Dgraph Go client
Please try the v1.1.1 image and let me know if you still face this issue.