Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-07-2019 02:08 AM
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?
04-08-2019 04:50 PM
I am also trying to do it with go but no success.. Any help?
04-09-2019 02:10 AM
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.
04-09-2019 05:03 AM
Thanks a lot, you saved the day for gophers!
01-25-2020 11:08 AM
@ali.ince I have been working with your example and it seems that the Go driver unwinds based on the index key of the map. 0, 1, 2, 3, etc. The results also seem to be returned in the same order as the index key on the map. Can you confirm this is the expected behaviour please or is this just a coincidence?
For our use case, we require the order in, to be the same as the order out, so that we can update the original slice of structs with the Node IDs.
We are migrating from Node.js, where unwinding an array, the order in was the same as the order out.
All the sessions of the conference are now available online