rexpro-client
A simple Rexster client for node.js implementing the binary protocol RexPro.
For more information about the RexPro protocol visit Rexster's wiki.
The client is implemented using q, so every method returns a promise.
Installation
npm install rexpro-client
Examples
Ad-hoc query
var RexProClient = ;var client =; // 'json' is the default.var query =script: "g.V.has('name', name).out()"bindings:name: "titan";client;
In session query
var session;client;
API
For a more detailed explanation about the parameters see the Rexster's wiki.
openSession(options)
Opens a session and returns the UUID for the session.
graph
- The name of the graph to open a session on. Optional.graphObjName
- The variable name of the graph object. Optional.username
- Used for authentication. Optional.password
- Used for authentication. Optional.
closeSession(options)
Closes a session and returns true if it was successful.
session
- The UUID of the session you want to close.username
- Used for authentication. Optional.password
- Used for authentication. Optional.
execute(options)
Sends a script for execution to the server.
session
- The session's UUID. Optional.serializer
- The type of serialization that this request will use. Optionalgraph
- The name of the graph to open a session on. Optional.graphObjName
- The variable name of the graph object. Optional.inSession
- Indicates this request should be executed in the supplied session. Defaults to false.isolate
- If true bindings from previous messages are not available. Defaults to true.transaction
- Execute the script within a transaction. Defaults to true.console
- If true a console response will be returned. Defaults to false.script
- The script to be executed. Optional.bindings
- An object with the bindings tot he gremlin engine. Optional.
License
MIT