Class: Graph

Graph(graphId, hostopt, portopt, optionsopt)

RedisGraph client

Constructor

new Graph(graphId, hostopt, portopt, optionsopt)

Creates a client to a specific graph running on the specific host/post See: node_redis for more options on createClient
Parameters:
Name Type Attributes Description
graphId string the graph id
host string | RedisClient <optional>
Redis host or node_redis client
port string | int <optional>
Redis port
options ClientOpts <optional>
node_redis options
Source:

Methods

_extractStrings(resultSet) → {Array.<string>}

Auxiliary function to extract string(s) data from procedures such as: db.labels, db.propertyKeys and db.relationshipTypes
Parameters:
Name Type Description
resultSet ResultSet a procedure result set
Source:
Returns:
strings array.
Type
Array.<string>

buildParamsHeader(params) → {string}

Extracts parameters from dictionary into cypher parameters string.
Parameters:
Name Type Description
params Map parameters dictionary.
Source:
Returns:
a cypher parameters string.
Type
string

callProcedure(procedure, argsopt, yopt) → {ResultSet}

Calls procedure
Parameters:
Name Type Attributes Description
procedure string Procedure to call
args Array.<string> <optional>
Arguments to pass
y Array.<string> <optional>
Yield outputs
Source:
Returns:
a promise contains the procedure result set data
Type
ResultSet

close()

Closes the client.
Source:

(async) deleteGraph() → {ResultSet}

Deletes the entire graph
Source:
Returns:
a promise contains the delete operation running time statistics
Type
ResultSet

(async) fetchAndGetLabel(id) → {string}

Retrieve all the labels from the graph and returns the wanted label
Parameters:
Name Type Description
id int internal ID of label.
Source:
Returns:
String label.
Type
string

(async) fetchAndGetProperty(id) → {string}

Retrieves al the properties from the graph, and returns the wanted property
Parameters:
Name Type Description
id int internal ID of property.
Source:
Returns:
String property.
Type
string

(async) fetchAndGetRelationship(id) → {string}

Retrieves al the relationships types from the graph, and returns the wanted type
Parameters:
Name Type Description
id int internal ID of relationship type.
Source:
Returns:
String relationship type.
Type
string

getLabel(id) → {string}

Retrieves label by ID.
Parameters:
Name Type Description
id int internal ID of label.
Source:
Returns:
String label.
Type
string

getProperty(id) → {string}

Retrieves property name by ID.
Parameters:
Name Type Description
id int internal ID of property.
Source:
Returns:
String property.
Type
string

getRelationship(id)

Retrieves relationship type by ID.
Parameters:
Name Type Description
id int internal ID of relationship type.
Source:
Returns:
String relationship type.

(async) labels()

Retrieves all labels in graph.
Source:

paramToString(paramValue) → {string}

Transforms a parameter value to string.
Parameters:
Name Type Description
paramValue object
Source:
Returns:
the string representation of paramValue.
Type
string

(async) propertyKeys()

Retrieves all properties in graph.
Source:

(async) query(query, paramsopt) → {ResultSet}

Execute a Cypher query
Parameters:
Name Type Attributes Description
query string Cypher query
params Map <optional>
Parameters map
Source:
Returns:
a promise contains a result set
Type
ResultSet

(async) relationshipTypes()

Retrieves all relationship types in graph.
Source: