Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-01-2020 12:00 PM
Hello!
I'm trying to unmarshal the result
(res) but it's throwing me an error. Anyone know a way to do this properly?
res, err := tx.Run("MATCH result=(p:Products) <-[r1:PRODUCES]- (i:Inventory) -[r2:OWNED_BY]->() return result",
map[string]interface{}{"skip": skip, "limit": limit})
if err != nil {
return nil, err
}
for res.Next() {
m := make(map[string]interface{})
d := res.Record().GetByIndex(0)
err := json.Unmarshal([]byte(fmt.Sprintf("%v", &d)), &m)
fmt.Println(m, err)
}
Error :
map[] invalid character 'x' after top-level value
Thanks!
09-02-2020 07:11 PM
I'm still stuck with this. Could I get some help?
I came across this but just not sure if it's recommended for neo4j ?
import (
_ "github.com/wfreeman/cq"
"database/sql"
"github.com/jmoiron/sqlx"
"log"
)
type Person struct {
Name string `db:"first_name"`
Email string
}
func main() {
db, err := sqlx.Connect("neo4j-cypher", "http://localhost:7474")
if err != nil {
log.Fatalln(err)
}
people := []Person{}
db.Select(&people, "MATCH (n:Person) RETURN n.name AS first_name, n.email AS email")
}
12-29-2020 04:38 PM
I don't know GoLang (or what unmarshal means), but the error message doesn't make sense to me. What "x" is the err msg referring to?
I only see the letter x
in tx and Next
Sorry....
All the sessions of the conference are now available online