Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

305
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda