nuagedb-client
v2.1.3
Published
Javascript client for nuagedb, a graph database service focused on delivering low latency and consistent responses from concise traversal queries
Downloads
3
Readme
Introduction
The nuagedb-client lets you communicate with the nuagedb-service API.
Installation
For nodejs,
npm i nuagedb-client
For browser,
<script src="https://rawgit.com/kawanet/msgpack-lite/master/dist/msgpack.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/nuagedb-client/NuageDBClient.min.js"></script>
Getting started
// Configure the connector
NuageDBClient.accessToken = 'xxx'; // define your access token
NuageDBClient.host = 'ge.galmiza.net'; // define API endpoint
// Instanciate the connector and run your query
var g = new NuageDBClient(); // connect to the graph engine service
g.V().count().done(console.log); // run your first query (with callback)
console.log(await g.V().count().done()); // run your first query (with await)
Basic usage
// Add vertices in the graph
g.addV({id:"john",label:"User",age:34}).done(console.log);
g.addV([{id:"lila",label:"User",age:25},
{id:"lena",label:"User",age:26}]).done(console.log);
// Read a vertex
g.V("lena").done(console.log);
// Add an edge between vertices
g.addE({in:"john",label:"knows",out:"lena"}).done(console.log);
// Search who knows lena
g.V("lena").in("knows").done(console.log);