Top level objects

Modules

Members

String

version

Returns the version of the package

Global
This member is global

Functions

createExecutionProfile

(String name, Object options)

Creates an ExecutionProfile suitable for executing graph traversals as generated by queryFromTraversal() and queryFromBatch().

Global
This function is global
Examples:
const { Client } = require('cassandra-driver');
const dseGraph = require('cassandra-driver-graph');
// Use a single Client instance
// Create the execution profile once using this method
const client = new Client({
  contactPoints: ['h1', 'h2'],
  localDataCenter: 'my_graph_dc',
  profiles: [
    dseGraph.createExecutionProfile('graph-oltp-traversal')
  ]
});
// Obtain a new traversal source.
const g = dseGraph.traversalSource(client);
const query = dseGraph.queryFromTraversal(g.V().hasLabel('person'));
// Reference the execution profile previously created.
client.executeGraph(query, null, { executionProfile: 'graph-oltp-traversal'}, function(err, result) {
  assert.ifError(err);
  console.log('User email ' + result.first().email);
});
Parameters:
Name Type Description
name String

Name of the execution profile.

options Object

The options as defined in the DataStax Driver.

Returns:
Type Description
ExecutionProfile

queryFromBatch

(Array batch)

Returns the string representation in GraphSON2 format of the batch of traversals to be used in graph executions.

Global
This function is global
Parameters:
Name Type Description
batch Array
Returns:
Type Description
String

queryFromTraversal

(traversal)

Returns the string representation in GraphSON2 format of the traversal to be used in graph query executions.

Global
This function is global
Parameters:
Name Type Description
traversal

The Gremlin traversal instance to be converted to string.

Returns:
Type Description
String

traversalSource

(Client client, [GraphQueryOptions options])

Creates a new graph traversal source. If no arguments are provided, a simple and non-iterable traversal source is used. This can be used to generate queries using queryFromTraversal(). Alternatively, providing a Client and optionally GraphQueryOptions creates an iterable traversal source that works with a remote DSE graph instance.

Global
This function is global
Parameters:
Name Type Description
client Client

The Client instance.

options optional GraphQueryOptions

The graph query options.

Returns:
Type Description
GraphTraversalSource

Returns an Apache TinkerPop GraphTraversalSource.