0

Can I use the neography DSL to do this query?

Neo.execute_query "
  MATCH (user:User{id: #{id}})
  SET user.name = '#{given_name} #{surname}'
  SET user.email = '#{email}'
"
John Bachir
  • 22,495
  • 29
  • 154
  • 227

1 Answers1

1

Neography is not a DSL, but a wrapper around the REST API of Neo4J. As long as your query is a valid Cypher one, you can execute it like that. In you case, the 'id' is not a classic property, so I think you cannot use it like that. You may rewrite your query like this:

START user=node(#{id}) SET user.name = '#{given_name} #{surname}' SET user.email = '#{email}'

You may want to use parameters as well: http://docs.neo4j.org/chunked/milestone/rest-api-cypher.html

RaduK
  • 1,463
  • 10
  • 16