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

87
Views
Run Neo4j queries from Cypher files in Javascript

I am using the official Neo4j Javascript driver to connect with my database. I want to run queries directly from .cypher files because writing them as strings is much more error-prone.

I don't want to read the file using fs, as it would consume unnecessary resources. I want to import the file as I do with a JSON file (at compile time)

How can I do that?

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

0

You could use the approach that is used in graphacademy for test fixtures.

There a js file is imported that holds the fixtures as javascript objects.

You can do the same just with Cypher queries.

See:

https://github.com/neo4j-graphacademy/app-nodejs/blob/main/test/fixtures/movies.js

import { goodfellas, popular } from '../../test/fixtures/movies.js'

https://github.com/neo4j-graphacademy/app-nodejs/blob/main/src/services/movie.service.js#L1

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!