Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on_create_set() with set() generates invalid cypher #332

Open
aekobear opened this issue Sep 10, 2019 · 1 comment · May be fixed by #333
Open

on_create_set() with set() generates invalid cypher #332

aekobear opened this issue Sep 10, 2019 · 1 comment · May be fixed by #333

Comments

@aekobear
Copy link

I'm trying to merge a node, set a property if a new node was created, and set another property regardless of create or match. The cypher for this works perfectly:

MERGE (t:Thing { name: 'something' })
ON CREATE SET t.created = 'yes'
SET t.foo = 'bar'

However, the neo4j-core Query:

q.merge(t: { Thing: { name: 'something' } })
  .on_create_set(t: { created: 'yes' })
  .set(t: { foo: 'bar' })

generates the cypher:

MERGE (t:Thing { name: 'something' })
SET t.foo = 'bar'
ON CREATE SET t.created = 'yes'

which is invalid because ON CREATE must immediately follow MERGE.

Runtime information:

Neo4j database version: 3.5.6 (Community)
neo4j-core gem version: 9.0.0

@aekobear
Copy link
Author

I will try to create a pull request for this one

@aekobear aekobear linked a pull request Sep 11, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant