Registry / database / gremlin-orm

gremlin-orm

JSON →
library1.1.9jsnpmunverified

Gremlin ORM for Node.js (v1.1.9) providing an object-relational mapping layer for graph databases, currently supporting Neo4j and Microsoft Azure Cosmos DB. It allows defining vertex and edge models with property validation, and running Gremlin queries. Uses the gremlin-javascript client for WebSocket connections. Release cadence appears low, last updated 2018. Development status: maintenance.

npm install gremlin-orm
INSTALL
IMPORT
SIG · GREMLIN-ORM
G
gremlin-orm
databasejavascriptv1.1.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const gremlinOrm = require('gremlin-orm');
import gremlinOrm from 'gremlin-orm';
This package uses CommonJS require. ESM import may not work without interop.
gremlinOrm constructor
const g = new gremlinOrm('neo4j');
Dialect is first argument; string for Neo4j, array for Azure.
Model definition
const Person = g.define('person', { name: { type: g.STRING } });
const Person = define('person', { ... });
define is a method on the gremlinOrm instance.

Shows how to initialize gremlin-orm, define a vertex model, create a vertex, and find a vertex using callbacks.

const gremlinOrm = require('gremlin-orm'); const g = new gremlinOrm('neo4j', process.env.GREMLIN_PORT || '8182', process.env.GREMLIN_HOST || 'localhost', { ssl: false }); const Person = g.define('person', { name: { type: g.STRING, required: true }, age: { type: g.NUMBER } }); Person.create({ name: 'Alice', age: 30 }, (err, result) => { if (err) console.error(err); else console.log(JSON.stringify(result)); }); Person.find({ name: 'Alice' }, (err, result) => { if (err) console.error(err); else console.log(JSON.stringify(result)); });
Debug
Known issues
deprecatedPackage has not been updated since 2018. Dependencies may be outdated and contain security vulnerabilities.
fix
Consider migrating to active alternatives like gremlin-javascript or type-orm for graph databases.
affects: all
gotchaRequire returns a constructor function, not an object with methods.
fix
Use 'new gremlinOrm(dialect)' to instantiate.
affects: all
gotchaDialect must be a string for Neo4j or an array for Azure Cosmos DB. Incorrect type may cause errors.
fix
For Neo4j: new gremlinOrm('neo4j'). For Azure: new gremlinOrm(['azure', 'partitionName'], ...).
affects: all
Errors
Common errors & fixes
TypeError: gremlinOrm is not a constructor
Omitting 'new' keyword or using wrong import pattern.
fix
Use: const gremlinOrm = require('gremlin-orm'); const g = new gremlinOrm('neo4j');
Cannot find module 'gremlin'
gremlin-javascript peer dependency not installed.
fix
Run: npm install gremlin
Upgrade
Version history
1.1.9latest on npm
Audit
Dependencies
gremlinrequiredRequired for connecting to Gremlin Server (WebSocket client).
Agent activity
5 hits · last 30 days
node
4
Resources
gremlin-orm — npm install gremlin-orm · libregistry