neogma icon indicating copy to clipboard operation
neogma copied to clipboard

match on create does not seem to be able to be created with the QueryBuilder

Open Eforen opened this issue 3 years ago • 2 comments

I could be wrong but there does not seem to be a way to build an ON CREATE query like this

MERGE (keanu:Person {name: 'Keanu Reeves'})
ON CREATE
  SET keanu.created = timestamp()
RETURN keanu.name, keanu.created

This example taken from the Neo4j Docs

Eforen avatar May 25 '21 08:05 Eforen

Correct. This cannot be built by using only build-in operators, but it can be built by using raw. For example:

.merge(...)
.raw(`ON CREATE SET keanu.created = timestamp()`)
.return([...]);

themetalfleece avatar May 25 '21 12:05 themetalfleece

Good to know thats better then just using raw but would be good to be able to use native

Eforen avatar May 26 '21 19:05 Eforen