Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

315
Views
Neo4j CREATE 2022+ syntax Node.js

What is the currently acceptable syntax for sending a CREATE script from Node.js to Neo4j in 2022 and after?

I am getting several errors trying to pass in dynamic props from form input fields.

I need to create a new record from my form inputs using Node.js.

This is an example of a syntax that is no longer accepted:

app.post('/books/add', function(req, res){
  var title = req.body.title;
  var year = req.body.year;

    session
    .run('CREATE(n:Book {title: {paramTitle}, year: {paramYear}}) RETURN n:title', {paramTitle:title, paramYear:year})
    .then(
      function(result){
        res.redirect('/');
        session.close();
      }
    )
    .catch(function(error){
      console.log(error)
    });

  res.redirect('/');
});

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The syntax you're using is deprecated. Parameters are now identified with the dollar symbol $ instead of curly brackets {}. That means you need to update your query to:

.run(
    'CREATE(n:Book {title: $paramTitle, year: $paramYear}) RETURN n:title',
    {
        paramTitle: title, 
        paramYear: year
    }
)

See relevant documentation here: https://neo4j.com/docs/cypher-manual/current/syntax/parameters/

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!