OrientDB-Sugar
Provides syntactic sugar, including gremlin-like operators, for Graph database operations on OrientDB.
API documentation
Usage
{ // Connect to your server const client = host: 'localhost' port: 2424 username: 'leroyjenkins' password: 'ohgodhesgoingin' manageSchema: true // <-- Enables automatic creation of classes, properties, and indices. log: consolelog // <-- Enables you to see what commands and queries are being run. const db = client // Define a schema const Actor = db index'name' 'unique' const ActedIn = db const StarredIn = db const Film = db index'name' 'unique' // Add some data // Create a vertex const tomHanks = await Actor // Create another vertex const big = await Film // Create an edge await ActedIn // Another way: Learning // By reference, "Learn Tom Hanks acted in Big" await db // By anonymous, "Learn actor Jared Rushton acted in film Big as Billy". // This method assumes the only property of the first object is the class, // and the first property of the inner object is the unique identifier. await db // Bulk learning // Actors Robert Downey Jr., Chris Evans, Mark Ruffalo, Chris Hemsworth, Scarlett Johansson, // acted in Avengers, Avengers: Age of Ultron, Avengers: Infinity War, and Avengers: Endgame await db // Get a single record const rdj = await Actor // Traverse the graph by reference, and retrieve many records as an array. const costars = await Actor console console // Traverse the graph by anonymous, and stream results using async generator. for await let film of db console // Close the connection await client}