OrientJS OGM for Node.JS
Simple Object Graph Mapper based on ES6 classes and using ES7 decorators.
Installation
Install via npm.
npm install ogm
Running Tests
To run the test suite, first invoke the following command within the repo, installing the development dependencies:
npm install
Then run the tests:
npm test
Features
- Using official OrientDB driver for node.js orientjs.
- Intuitive API, based on next gen javascript.
Usage
Configuring the client.
; var server = ogm;
Using an existing database
var db = ogm;console;
Using an existing database with credentials
var db = ogm;console;
Defining simple model
@ogmV @ogm name = thisname; @ogm age = thisage;
Create, Edit, Save and Delete from model
var john = name: 'John'; // Saving new instanceawait john; // Editing propertiesjohnage = 12; //Saving changesawait john; //Deleting instanceawait john;
Query model
var john = await Person; // Getting by ridvar john = await Person;