Showing results for 
Search instead for 
Did you mean: 

Cypher.js - graph db and Cypher query engine written in javascript

Node Clone

Hi everyone!

I’d like to introduce my side project Cypher.js - a graph database and Cypher query engine written in javascript.

Have fun with it!

Niclas Kjäll-Ohlsson


Node Clone

This was originally created to do further analysis in-browser of graph result sets from Neo4j backend.

I am also using it in several analytical web apps at work. This to do slicing, dicing and analysis of data in-browser for the web app.

A nice feature is that you can run Cypher directly on json data from http endpoints:

Cypher query from above link:

load json from "" as l
with collect(l) as rows
unwind rows as row
unwind row['values'] as v
with rows[0].datasource as datasource,
  row.key[0].en as series, collect({d: v[0], v: v[1]}) as c,
  stdev(v[1]) as series_std_dev,
  sum(v[1])/count(1) as series_avg
unwind c as e
  tostring(todate(e.d)) as date,
  e.v as val,
  (e.v-series_avg)/series_std_dev as val_z_score,

And you can also run cypher directly on javascript objects (e.g. json) that you have already loaded in the web app

load json from your_javascript_object as d
return d

And also possible to load csv data from http endpoints:
Cypher query from link:

load csv with headers from "" as l
merge (:Character{name:l.Source})
merge (:Character{name:l.Target})
with l
match (source:Character{name:l.Source}),
merge (source)-[r:KNOWS{weight:l.Weight}]->(target)
return source, r, target

Note on above. Querying javascript objects only works when running Cypher.js in same thread as browser, i.e. not as a web worker. A web worker does not share scope with the browser main thread so cannot access variables from there


@niclasko This is great! Have been wondering if there was something like this for awhile, glad I stumbled upon this. 

What version of Cypher is this compatible with? Are there any limitations or APIs that aren't implemented?