{"action":"opened","issue":{"url":"https://api.github.com/repos/jmcvetta/neoism/issues/104","repository_url":"https://api.github.com/repos/jmcvetta/neoism","labels_url":"https://api.github.com/repos/jmcvetta/neoism/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/jmcvetta/neoism/issues/104/comments","events_url":"https://api.github.com/repos/jmcvetta/neoism/issues/104/events","html_url":"https://github.com/jmcvetta/neoism/issues/104","id":231856871,"number":104,"title":"Arrays as parameters,- how does it work for Neoism?","user":{"login":"tkandal","id":7890211,"avatar_url":"https://avatars0.githubusercontent.com/u/7890211?v=3","gravatar_id":"","url":"https://api.github.com/users/tkandal","html_url":"https://github.com/tkandal","followers_url":"https://api.github.com/users/tkandal/followers","following_url":"https://api.github.com/users/tkandal/following{/other_user}","gists_url":"https://api.github.com/users/tkandal/gists{/gist_id}","starred_url":"https://api.github.com/users/tkandal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkandal/subscriptions","organizations_url":"https://api.github.com/users/tkandal/orgs","repos_url":"https://api.github.com/users/tkandal/repos","events_url":"https://api.github.com/users/tkandal/events{/privacy}","received_events_url":"https://api.github.com/users/tkandal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-28T09:14:51Z","updated_at":"2017-05-28T09:14:51Z","closed_at":null,"body":"Hello\r\n\r\nWe are doing a project in Node.js,- but I plan to do the same in Go.\r\nI do this to measure the effort going into doing this in Go vs Node.js and also difference in performance.\r\nThe Node.js implementation uses a BOLT-driver and I have mostly kind of copied the queries.\r\nThis query works fine for Node.js and BOLT,- but not for Go and Neoism.  I have also ran the query manually in the browser directly against a Neo4J-instance (of course with replacements for the parameters).\r\n\r\n`\r\nresult := []struct {\r\n    Hierarchy neoism.Node\r\n    Ous       []neoism.Node\r\n}{}\r\n\r\nquery := neoism.CypherQuery{\r\n\t\tStatement: ``MERGE (hierarchy:Hierarchy {id: {hierarchyId}})\r\n                SET hierarchy.user = {user}\r\n                SET hierarchy.timestamp = {timestamp}\r\n                WITH hierarchy, {ouIds} AS ids\r\n                MATCH (hierarchy)-[h:has]->(ouId:OuId) WHERE NOT ouId.ouId IN ids\r\n                    DELETE h\r\n                WITH hierarchy, ids\r\n                UNWIND ids AS id\r\n                MERGE (ouId:OuId {ouId: id})\r\n                WITH hierarchy, ouId\r\n                MATCH (hierarchy) WHERE NOT (hierarchy)-[:has]->(ouId)\r\n                    CREATE (hierarchy)-[:has]->(ouId)\r\n                RETURN\r\n                    hierarchy,\r\n                    COLLECT(DISTINCT ouId) AS ous;``,\r\n\t\tParameters: neoism.Props{\r\n\t\t\t\"hierarchyId\": h, // String\r\n\t\t\t\"user\":        hierarchy.LastModified.User, // String\r\n\t\t\t\"timestamp\":   modified.UnixNano(), // int64\r\n\t\t\t\"ouIds\":       hierarchy.Ous, // [int64, int64, ... ]\r\n\t\t},\r\n\t\tResult: &result,\r\n\t}\r\n\r\nqs := []*neoism.CypherQuery{}\r\n\r\nvar tx *neoism.Tx\r\nif tx, err = db.Begin(qs); err != nil {\r\n    w.WriteHeader(http.StatusInternalServerError)\r\n    json.NewEncoder(w).Encode(model.ErrorResponse{Error: err})\r\n    return\r\n}\r\n\r\nif err = db.Cypher(&query); err != nil {\r\n    w.WriteHeader(http.StatusInternalServerError)\r\n    json.NewEncoder(w).Encode(model.ErrorResponse{Error: errors.New(\"Query failed!\")})\r\n    return\r\n}\r\nif err = tx.Commit(); err != nil {\r\n    w.WriteHeader(http.StatusInternalServerError)\r\n    json.NewEncoder(w).Encode(model.ErrorResponse{Error: err})\r\n    return\r\n}\r\nif len(result) == 0 {\r\n    log.Printf(\"No results!\\n\")\r\n    w.WriteHeader(http.StatusInternalServerError)\r\n    return\r\n}\r\n`\r\nThe hierarchy-node is created in the database, but the rest is ignored.  Commit also seems to work.\r\nOn the Go side the only symptom I get is that result is empty.\r\n\r\nAm I doing something very wrong?"}}
{"actor":{"display_login":"tkandal"}}