UNWIND with the official Go driver

(Simondrake1990+Neo4j) #1

Does anyone have an example of an UNWIND statement they've done to run multiple CREATE statements?

I am able to do it, but I have to pass in an array of map[string][string] which is a bit ugly. I don't know if there's a way to pass in a Struct or anything?


(Gigauser) #2

I am also trying to do it with go but no success.. Any help?


(Ali Ince) #3

The go driver only accepts a map[string]interface{} as parameters and do not support passing struct types. My suggestion would be parallel to what you're already doing, like mapping your own array of struct values to into array of map[string]interface{} and providing that result as a parameter.

I have added a simple gist to showcase a simple way to go forward.

1 Like

(Gigauser) #4

Thanks a lot, you saved the day for gophers!