-
-
Notifications
You must be signed in to change notification settings - Fork 3
Home
dr.dimitru edited this page Jan 23, 2017
·
6 revisions
propertyKeys()
labels()
relationshipTypes()
version()
graph(cypher, [opts, callback])
queryOne(cypher, [opts])
querySync(cypher, [opts])
queryAsync(cypher, [opts, callback])
query(cypher, [opts, callback])
cypher(cypher, [opts, callback])
batch(tasks, [settings, callback])
-
Neo4jTransaction
transaction([settings, opts])
-
Neo4jNode
nodes([id, reactive])
-
Neo4jRelationship
relationship.create(from, to, type, [properties])
-
Neo4jRelationship
relationship.get(id, [reactive])
constraint.create(label, keys, [type])
constraint.drop(label, key, [type])
constraint.get([label, key, type])
index.create(label, keys)
index.get([label])
index.drop(label, key)
get()
delete()
update([force])
degree([direction, types])
to(to, type, [properties])
from(from, type, [properties])
path(to, type, [settings])
relationships([direction, types, reactive])
property(name, [value])
properties.get([name])
properties.set(name, [value])
properties.delete([names])
properties.update(nameValue)
label([labels])
labels.set(labels)
labels.replace(labels)
labels.delete(labels)
index.create(label, key, [type])
index.get(label, key, [type])
index.drop(label, key, [type])
get()
delete()
property(name, [value])
properties.get([name])
properties.set(name, [value])
properties.delete([names])
properties.update(nameValue)
index.create(label, key, [type])
index.get(label, key, [type])
index.drop(label, key, [type])
// Require neo4j-fiber
const Neo4jDB = require('neo4j-fiber').Neo4jDB;
// Connect to DB:
const db = new Neo4jDB('http://localhost:7474', {username: 'neo4j', password: '1234'});
// Create some nodes:
const users = [];
users.push(db.nodes(name: 'Frank').labels.set('User'));
users.push(db.nodes(name: 'Billy').labels.set('User'));
users.push(db.nodes(name: 'Joe').labels.set('User'));
const NYC = db.nodes(title: 'NYC').labels.set('City');
const Washington = db.nodes(title: 'Washington').labels.set('City');
const SF = db.nodes(title: 'San Francisco').labels.set('City');
// Create some relationships:
NYC.to(Washington, "TRANSFER", {distance: 226});
Washington.to(SF, "TRANSFER", {distance: 2905});
users[0].to(users[1], "KNOWS", {since: +new Date()});
users[1].to(users[2], "KNOWS", {since: +new Date()});
users.forEach((user) => {
user.to(NYC, "LIVES AT", {since: 0});
});
// Change some nodes
NYC.property('location', {lat: x, lon: y});
users[1].properties.set({surname: 'Ross'});
// Find route between two cities
NYC.path(SF, "TRANSFER", {cost_property: 'distance', algorithm: 'dijkstra'});
propertyKeys()
labels()
relationshipTypes()
version()
graph()
queryOne()
querySync()
queryAsync()
query()
cypher()
batch()
transaction()
nodes()
relationship.create()
relationship.get()
constraint.create()
constraint.drop()
constraint.get()
index.create()
index.get()
index.drop()
get()
delete()
update()
degree()
to()
from()
path()
relationships()
property()
properties.get()
properties.set()
properties.delete()
properties.update()
label()
labels.set()
labels.replace()
labels.delete()
index.create()
index.get()
index.drop()