Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-14-2019 10:42 PM
result, err = session.Run("with $inputword as list match (p:Person) where p.name in list return p.age as ages",
map[string]interface{}{"inputword": "['name1', 'name2']"})
The query work well in web browser but not in Go program.
03-14-2019 11:06 PM
Not 100% sure, but I believe you need to do something like this:
cypher := `with $inputword as list match (p:Person) where p.name in list return p.age as ages`
result, err = session.Run(cypher, map[string]interface{}{
"inputword": []string{"name1", "name2"},
})
03-15-2019 07:30 AM
@gigauser, In the code you've pasted, you're passing inputword
as a string - not a list; that wouldn't work as intended.
You can however, send them as a slice in go so that they're encoded as lists as intended.
session.Run("with $inputword as list match (p:Person) where p.name in list return p.age as ages", map[string]interface{}{"inputword": []string{ "name1", "name2" }})
All the sessions of the conference are now available online