Fluent Neo4j
This package allows you to run any cypher query you like agains your Neo4j instance in a promise-style.
The results will be formatted for your convenience.
To build the query check out the API docs of fluent-cypher
Table of Contents
Usage
You'll need to set env params to connect to neo4j
export NEO4J_URL="bolt://localhost:7687"export NEO4J_USER="neo4j"export NEO4J_PASS="neo4j"
Now you can use the package on the server.
const Neo4jQuery = //or
constuctor([options])
var query =
See constructor options of fluent-cypher
Methods
All methods return a promise. So after any fetch method building the query is not possible anymore.
.fetch([extractAlias])
Returns the first row of results as an object and if specified accesses the alias of the row.
fetchOne([extractAlias])
Returns the first record, if specified the result will be brought top-level accessing the alias given.
)
run()
Runs the native run
method of the driver returning unformatted results.
Use this method if you don't care about the result as it skips parsing of the result object.
example: Get the query result as the driver returns it
How to run tests
This will test against an online test instance
npm test
This will test against a local instance - you'll need to set env vars.
WARNING: Make sure you are using a test database as this adds and deletes data!
npm run test-local