1

I'm using neo4j.rb, and when I run

MATCH (a {name:'apple'}) SET a.flag = true

I'd like to get the response data, which would be along the lines of:

{
  "results": [
    {
      "columns": [],
      "data": [],
      "stats": {
        "contains_updates": true,
        "nodes_created": 0,
        "nodes_deleted": 0,
        "properties_set": 1,
        "relationships_created": 0,
        "relationship_deleted": 0,
        "labels_added": 0,
        "labels_removed": 0,
        "indexes_added": 0,
        "indexes_removed": 0,
        "constraints_added": 0,
        "constraints_removed": 0
      }
    }
  ],
  "errors": []
}

Instead, I get nothing--the object is blank, I suppose because I'm not asking for nodes to be returned, but want metadata on the query results.

There's a proposed solution here using py2neo (py2neo return number of nodes and relationships created), with includeStats: true, and I've also tried appending it to the address I'm using to run queries as ?includeStats=true, which I saw somewhere else and resulted in a server not available error (response code 302 / RuntimeError) for me. Is there any solution for this using neo4j.rb ?

Community
  • 1
  • 1
stephen
  • 195
  • 9

1 Answers1

1

Unfortunately we don't keep the metadata when returning results in the neo4j-core gem. It might be something that's easy to add. Perhaps you could create an issue:

https://github.com/neo4jrb/neo4j-core/issues

Pull requests are welcome, of course!

Brian Underwood
  • 10,746
  • 1
  • 22
  • 34